SHOW:
|
|
- or go back to the newest paste.
| 1 | - | // System von Barney' | AimLike' |
| 1 | + | |
| 2 | ||
| 3 | - | #include <Dini> |
| 3 | + | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 4 | ||
| 5 | - | #define DIALOG_LOGIN 1 |
| 5 | + | forward CheckStatus(); |
| 6 | - | #define DIALOG_REGISTER 2 |
| 6 | + | |
| 7 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 8 | - | #define COLOR_GREEN 0x33AA33AA |
| 8 | + | |
| 9 | - | #define COLOR_RED 0xAA3333AA |
| 9 | + | new PlayerVehicle[212][] = {
|
| 10 | "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", | |
| 11 | - | enum PlayerDA |
| 11 | + | "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", |
| 12 | "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", | |
| 13 | - | Level, |
| 13 | + | "Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", |
| 14 | - | Admin |
| 14 | + | "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", |
| 15 | "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", | |
| 16 | - | new Spieler[MAX_PLAYERS][PlayerDA]; |
| 16 | + | "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", |
| 17 | "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", | |
| 18 | - | main() |
| 18 | + | "Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", |
| 19 | "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster","Stunt", "Tanker", | |
| 20 | - | print("\n----------------------------------");
|
| 20 | + | "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", |
| 21 | - | print(" Login System");
|
| 21 | + | "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", |
| 22 | - | print("----------------------------------\n");
|
| 22 | + | "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", |
| 23 | "Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", | |
| 24 | "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", | |
| 25 | - | public OnGameModeInit() |
| 25 | + | "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog", |
| 26 | "Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)", | |
| 27 | - | SetGameModeText("Login Script");
|
| 27 | + | "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A", |
| 28 | - | AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); |
| 28 | + | "Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" }; |
| 29 | ||
| 30 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 31 | ||
| 32 | - | public OnGameModeExit() |
| 32 | + | //Booleans |
| 33 | new bool:TextDrawsShown[MAX_PLAYERS]; | |
| 34 | new bool:LightRedHealthCreated[MAX_PLAYERS]; | |
| 35 | new bool:LightYellowSpeedCreated[MAX_PLAYERS]; | |
| 36 | new bool:VHSCreated[MAX_PLAYERS]; | |
| 37 | - | public OnPlayerRequestClass(playerid, classid) |
| 37 | + | new bool:ExclamationShown[MAX_PLAYERS]; |
| 38 | ||
| 39 | - | SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); |
| 39 | + | //Timer |
| 40 | - | SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); |
| 40 | + | new CheckStatusTimer; |
| 41 | - | SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); |
| 41 | + | |
| 42 | //4all | |
| 43 | new Text:Black0; | |
| 44 | new Text:White1; | |
| 45 | new Text:White2; | |
| 46 | new Text:White3; | |
| 47 | - | new Playerdatei[128]; |
| 47 | + | new Text:BlackHealth; |
| 48 | new Text:DarkRedHealth; | |
| 49 | - | GetPlayerName(playerid,name,sizeof(name)); // Findet den Namen des Spielers heraus |
| 49 | + | new Text:BlackSpeed; |
| 50 | - | format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); // Gibt den Pfad zu den Accounts an. |
| 50 | + | new Text:DarkYellowSpeed; |
| 51 | - | if(dini_Exists(Playerdatei)) |
| 51 | + | new Text:Marker; |
| 52 | new Text:Exclamation; | |
| 53 | - | ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Login","Bitte geben sie nun ihr Passwort ein","Login","Abbrechen"); |
| 53 | + | |
| 54 | //4player | |
| 55 | new Text:VHS[MAX_PLAYERS]; | |
| 56 | new Text:LightRedHealth[MAX_PLAYERS]; | |
| 57 | - | ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registration","Bitte geben sie ihr gewünschtes Passwort ein","Registerieren","Abbrechen"); |
| 57 | + | new Text:LightYellowSpeed[MAX_PLAYERS]; |
| 58 | ||
| 59 | //Speed | |
| 60 | new Float:OldX[MAX_PLAYERS]; | |
| 61 | new Float:OldY[MAX_PLAYERS]; | |
| 62 | - | public OnPlayerDisconnect(playerid, reason) |
| 62 | + | new Float:OldZ[MAX_PLAYERS]; |
| 63 | ||
| 64 | - | if(GetPVarInt(playerid,"Eingeloggt") == 1) // Fragt ab ob wir Eingeloggt sind. |
| 64 | + | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 65 | ||
| 66 | - | SpielerSpeichern(playerid); // Speichert uns wenn wir Disconnecten - Funktionen erstellen wir jetzt! |
| 66 | + | public OnFilterScriptInit() |
| 67 | {
| |
| 68 | Black0 = TextDrawCreate(481.000000,353.000000,"_"); | |
| 69 | TextDrawUseBox(Black0,1); | |
| 70 | TextDrawBoxColor(Black0,0x00000099); | |
| 71 | - | public OnPlayerSpawn(playerid) |
| 71 | + | TextDrawTextSize(Black0,596.000000,0.000000); |
| 72 | TextDrawAlignment(Black0,0); | |
| 73 | TextDrawBackgroundColor(Black0,0x000000ff); | |
| 74 | TextDrawFont(Black0,3); | |
| 75 | TextDrawLetterSize(Black0,3.599999,7.599996); | |
| 76 | - | public OnPlayerDeath(playerid, killerid, reason) |
| 76 | + | TextDrawColor(Black0,0xffffffff); |
| 77 | TextDrawSetOutline(Black0,1); | |
| 78 | TextDrawSetProportional(Black0,1); | |
| 79 | TextDrawSetShadow(Black0,1); | |
| 80 | ||
| 81 | - | public OnVehicleSpawn(vehicleid) |
| 81 | + | White1 = TextDrawCreate(482.000000,354.000000,"_"); |
| 82 | TextDrawUseBox(White1,1); | |
| 83 | TextDrawBoxColor(White1,0xffffff66); | |
| 84 | TextDrawTextSize(White1,595.000000,-2.000000); | |
| 85 | TextDrawAlignment(White1,0); | |
| 86 | - | public OnVehicleDeath(vehicleid, killerid) |
| 86 | + | TextDrawBackgroundColor(White1,0x000000ff); |
| 87 | TextDrawFont(White1,1); | |
| 88 | TextDrawLetterSize(White1,1.700000,7.399997); | |
| 89 | TextDrawColor(White1,0xffffffff); | |
| 90 | TextDrawSetOutline(White1,1); | |
| 91 | - | public OnPlayerText(playerid, text[]) |
| 91 | + | TextDrawSetProportional(White1,1); |
| 92 | TextDrawSetShadow(White1,1); | |
| 93 | ||
| 94 | White2 = TextDrawCreate(483.000000,355.000000,"_"); | |
| 95 | TextDrawUseBox(White2,1); | |
| 96 | - | public OnPlayerCommandText(playerid, cmdtext[]) |
| 96 | + | TextDrawBoxColor(White2,0xffffff33); |
| 97 | TextDrawTextSize(White2,594.000000,0.000000); | |
| 98 | - | if (strcmp("/mycommand", cmdtext, true, 10) == 0)
|
| 98 | + | TextDrawAlignment(White2,0); |
| 99 | TextDrawBackgroundColor(White2,0x000000ff); | |
| 100 | - | // Do something here |
| 100 | + | TextDrawFont(White2,1); |
| 101 | - | return 1; |
| 101 | + | TextDrawLetterSize(White2,0.299999,7.199996); |
| 102 | TextDrawColor(White2,0xffffffff); | |
| 103 | - | return 0; |
| 103 | + | TextDrawSetOutline(White2,1); |
| 104 | TextDrawSetProportional(White2,1); | |
| 105 | TextDrawSetShadow(White2,1); | |
| 106 | - | public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) |
| 106 | + | |
| 107 | White3 = TextDrawCreate(484.000000,356.000000,"_"); | |
| 108 | TextDrawUseBox(White3,1); | |
| 109 | TextDrawBoxColor(White3,0xffffff33); | |
| 110 | TextDrawTextSize(White3,593.000000,-2.000000); | |
| 111 | - | public OnPlayerExitVehicle(playerid, vehicleid) |
| 111 | + | TextDrawAlignment(White3,0); |
| 112 | TextDrawBackgroundColor(White3,0x000000ff); | |
| 113 | TextDrawFont(White3,3); | |
| 114 | TextDrawLetterSize(White3,1.000000,7.000000); | |
| 115 | TextDrawColor(White3,0xffffffff); | |
| 116 | - | public OnPlayerStateChange(playerid, newstate, oldstate) |
| 116 | + | TextDrawSetOutline(White3,1); |
| 117 | TextDrawSetProportional(White3,1); | |
| 118 | TextDrawSetProportional(White3,1); | |
| 119 | TextDrawSetShadow(White3,1); | |
| 120 | ||
| 121 | - | public OnPlayerEnterCheckpoint(playerid) |
| 121 | + | BlackHealth = TextDrawCreate(487.000000,385.000000,"_"); |
| 122 | TextDrawUseBox(BlackHealth,1); | |
| 123 | TextDrawBoxColor(BlackHealth,0x00000099); | |
| 124 | TextDrawTextSize(BlackHealth,590.000000,-11.000000); | |
| 125 | TextDrawAlignment(BlackHealth,0); | |
| 126 | - | public OnPlayerLeaveCheckpoint(playerid) |
| 126 | + | TextDrawBackgroundColor(BlackHealth,0x000000ff); |
| 127 | TextDrawFont(BlackHealth,3); | |
| 128 | TextDrawLetterSize(BlackHealth,1.000000,0.399999); | |
| 129 | TextDrawColor(BlackHealth,0xffffffff); | |
| 130 | TextDrawSetOutline(BlackHealth,1); | |
| 131 | - | public OnPlayerEnterRaceCheckpoint(playerid) |
| 131 | + | TextDrawSetProportional(BlackHealth,1); |
| 132 | TextDrawSetShadow(BlackHealth,1); | |
| 133 | ||
| 134 | DarkRedHealth = TextDrawCreate(488.000000,386.000000,"_"); | |
| 135 | TextDrawUseBox(DarkRedHealth,1); | |
| 136 | - | public OnPlayerLeaveRaceCheckpoint(playerid) |
| 136 | + | TextDrawBoxColor(DarkRedHealth,0xff000066); |
| 137 | TextDrawTextSize(DarkRedHealth,589.000000,0.000000); | |
| 138 | TextDrawAlignment(DarkRedHealth,0); | |
| 139 | TextDrawBackgroundColor(DarkRedHealth,0x000000ff); | |
| 140 | TextDrawFont(DarkRedHealth,3); | |
| 141 | - | public OnRconCommand(cmd[]) |
| 141 | + | TextDrawLetterSize(DarkRedHealth,1.000000,0.199999); |
| 142 | TextDrawColor(DarkRedHealth,0xffffffff); | |
| 143 | TextDrawSetOutline(DarkRedHealth,1); | |
| 144 | TextDrawSetProportional(DarkRedHealth,1); | |
| 145 | TextDrawSetShadow(DarkRedHealth,1); | |
| 146 | - | public OnPlayerRequestSpawn(playerid) |
| 146 | + | |
| 147 | BlackSpeed = TextDrawCreate(536.000000,403.000000,"_"); | |
| 148 | TextDrawUseBox(BlackSpeed,1); | |
| 149 | TextDrawBoxColor(BlackSpeed,0x00000099); | |
| 150 | TextDrawTextSize(BlackSpeed,590.000000,0.000000); | |
| 151 | - | public OnObjectMoved(objectid) |
| 151 | + | TextDrawAlignment(BlackSpeed,0); |
| 152 | TextDrawBackgroundColor(BlackSpeed,0x000000ff); | |
| 153 | TextDrawFont(BlackSpeed,3); | |
| 154 | TextDrawLetterSize(BlackSpeed,1.000000,1.400000); | |
| 155 | TextDrawColor(BlackSpeed,0xffffffff); | |
| 156 | - | public OnPlayerObjectMoved(playerid, objectid) |
| 156 | + | TextDrawSetOutline(BlackSpeed,1); |
| 157 | TextDrawSetShadow(BlackSpeed,1); | |
| 158 | TextDrawSetProportional(BlackSpeed,1); | |
| 159 | ||
| 160 | DarkYellowSpeed = TextDrawCreate(537.000000,404.000000,"_"); | |
| 161 | - | public OnPlayerPickUpPickup(playerid, pickupid) |
| 161 | + | TextDrawUseBox(DarkYellowSpeed,1); |
| 162 | TextDrawBoxColor(DarkYellowSpeed,0xffff0033); | |
| 163 | TextDrawTextSize(DarkYellowSpeed,589.000000,0.000000); | |
| 164 | TextDrawAlignment(DarkYellowSpeed,0); | |
| 165 | TextDrawBackgroundColor(DarkYellowSpeed,0x000000ff); | |
| 166 | - | public OnVehicleMod(playerid, vehicleid, componentid) |
| 166 | + | TextDrawFont(DarkYellowSpeed,3); |
| 167 | TextDrawLetterSize(DarkYellowSpeed,1.000000,1.200000); | |
| 168 | TextDrawColor(DarkYellowSpeed,0xffffffff); | |
| 169 | TextDrawSetOutline(DarkYellowSpeed,1); | |
| 170 | TextDrawSetProportional(DarkYellowSpeed,1); | |
| 171 | - | public OnVehiclePaintjob(playerid, vehicleid, paintjobid) |
| 171 | + | TextDrawSetShadow(DarkYellowSpeed,1); |
| 172 | ||
| 173 | Marker = TextDrawCreate(511.000000,382.000000,"l"); | |
| 174 | TextDrawAlignment(Marker,0); | |
| 175 | TextDrawBackgroundColor(Marker,0x000000ff); | |
| 176 | - | public OnVehicleRespray(playerid, vehicleid, color1, color2) |
| 176 | + | TextDrawFont(Marker,1); |
| 177 | TextDrawLetterSize(Marker,0.099999,1.000000); | |
| 178 | TextDrawColor(Marker,0xffffffff); | |
| 179 | TextDrawSetOutline(Marker,1); | |
| 180 | TextDrawSetProportional(Marker,1); | |
| 181 | - | public OnPlayerSelectedMenuRow(playerid, row) |
| 181 | + | TextDrawSetShadow(Marker,1); |
| 182 | ||
| 183 | Exclamation = TextDrawCreate(579.000000,351.000000,"~r~!"); | |
| 184 | TextDrawAlignment(Exclamation,0); | |
| 185 | TextDrawBackgroundColor(Exclamation,0x000000ff); | |
| 186 | - | public OnPlayerExitedMenu(playerid) |
| 186 | + | TextDrawFont(Exclamation,2); |
| 187 | TextDrawLetterSize(Exclamation,1.200000,3.399999); | |
| 188 | TextDrawColor(Exclamation,0xffffffff); | |
| 189 | TextDrawSetOutline(Exclamation,1); | |
| 190 | TextDrawSetProportional(Exclamation,1); | |
| 191 | TextDrawSetShadow(Exclamation,1); | |
| 192 | ||
| 193 | CheckStatusTimer = SetTimer("CheckStatus", 1000, 1);
| |
| 194 | } | |
| 195 | ||
| 196 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 197 | ||
| 198 | public OnFilterScriptExit() | |
| 199 | {
| |
| 200 | KillTimer(CheckStatusTimer); | |
| 201 | ||
| 202 | TextDrawDestroy(Text:Black0); | |
| 203 | TextDrawDestroy(Text:White1); | |
| 204 | TextDrawDestroy(Text:White2); | |
| 205 | TextDrawDestroy(Text:White3); | |
| 206 | TextDrawDestroy(Text:BlackHealth); | |
| 207 | TextDrawDestroy(Text:DarkRedHealth); | |
| 208 | TextDrawDestroy(Text:BlackSpeed); | |
| 209 | TextDrawDestroy(Text:DarkYellowSpeed); | |
| 210 | TextDrawDestroy(Text:Marker); | |
| 211 | TextDrawDestroy(Text:Exclamation); | |
| 212 | for(new i=0; i<MAX_PLAYERS; i++) | |
| 213 | {
| |
| 214 | TextDrawDestroy(Text:VHS[i]); | |
| 215 | TextDrawDestroy(Text:LightRedHealth[i]); | |
| 216 | TextDrawDestroy(Text:LightYellowSpeed[i]); | |
| 217 | } | |
| 218 | } | |
| 219 | ||
| 220 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 221 | ||
| 222 | public OnPlayerConnect(playerid) | |
| 223 | {
| |
| 224 | TextDrawsShown[playerid] = false; | |
| 225 | VHSCreated[playerid] = false; | |
| 226 | LightRedHealthCreated[playerid] = false; | |
| 227 | LightYellowSpeedCreated[playerid] = false; | |
| 228 | } | |
| 229 | ||
| 230 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 231 | ||
| 232 | public CheckStatus() | |
| 233 | {
| |
| 234 | for(new i=0; i<MAX_PLAYERS; i++) | |
| 235 | {
| |
| 236 | if(IsPlayerConnected(i)) | |
| 237 | {
| |
| 238 | if(IsPlayerInAnyVehicle(i)) | |
| 239 | {
| |
| 240 | ||
| 241 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 242 | ||
| 243 | if(TextDrawsShown[i] == false) | |
| 244 | {
| |
| 245 | TextDrawShowForPlayer(i, Text:Black0); | |
| 246 | TextDrawShowForPlayer(i, Text:White1); | |
| 247 | TextDrawShowForPlayer(i, Text:White2); | |
| 248 | TextDrawShowForPlayer(i, Text:White3); | |
| 249 | TextDrawShowForPlayer(i, Text:BlackHealth); | |
| 250 | TextDrawShowForPlayer(i, Text:DarkRedHealth); | |
| 251 | TextDrawShowForPlayer(i, Text:BlackSpeed); | |
| 252 | TextDrawShowForPlayer(i, Text:DarkYellowSpeed); | |
| 253 | TextDrawShowForPlayer(i, Text:Marker); | |
| 254 | TextDrawsShown[i] = true; | |
| 255 | } | |
| 256 | ||
| 257 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 258 | ||
| 259 | new String[128]; | |
| 260 | new Float:X, Float:Y, Float:Z, Float:Distance; | |
| 261 | GetPlayerPos(i, X, Y, Z); | |
| 262 | Distance = floatsqroot(floatadd(floatadd(floatpower(floatsub(X, OldX[i]), 2), floatpower(floatsub(Y, OldY[i]), 2)), floatpower(floatsub(Z, OldZ[i]), 2))); | |
| 263 | new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i)); | |
| 264 | PlayerVehicleModelID -= 400; | |
| 265 | format(String,sizeof(String),"~b~Vehicle:~n~~w~%s~n~~b~Health:~n~~n~Speed:~n~~w~%im/h~n~%ikm/h", PlayerVehicle[PlayerVehicleModelID], floatround(floatmul(floatdiv(Distance, 1.609344), 2.0), floatround_floor), floatround(floatmul(Distance, 2.0), floatround_floor)); | |
| 266 | if(VHSCreated[i] == true) | |
| 267 | {
| |
| 268 | TextDrawDestroy(VHS[i]); | |
| 269 | } | |
| 270 | VHS[i] = TextDrawCreate(485.000000,355.000000,String); | |
| 271 | TextDrawAlignment(VHS[i],0); | |
| 272 | TextDrawBackgroundColor(VHS[i],0x000000ff); | |
| 273 | TextDrawFont(VHS[i],1); | |
| 274 | TextDrawLetterSize(VHS[i],0.299999,1.000000); | |
| 275 | TextDrawColor(VHS[i],0xffffffff); | |
| 276 | TextDrawSetOutline(VHS[i],1); | |
| 277 | TextDrawSetProportional(VHS[i],1); | |
| 278 | TextDrawSetShadow(VHS[i],1); | |
| 279 | TextDrawShowForPlayer(i, VHS[i]); | |
| 280 | VHSCreated[i] = true; | |
| 281 | ||
| 282 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 283 | ||
| 284 | new Float:CarHealth; | |
| 285 | GetVehicleHealth(GetPlayerVehicleID(i), CarHealth); | |
| 286 | if(LightRedHealthCreated[i] == true) | |
| 287 | {
| |
| 288 | TextDrawDestroy(LightRedHealth[i]); | |
| 289 | } | |
| 290 | LightRedHealth[i] = TextDrawCreate(488.000000,386.000000,"_"); | |
| 291 | TextDrawUseBox(LightRedHealth[i],1); | |
| 292 | TextDrawBoxColor(LightRedHealth[i],0xff000099); | |
| 293 | TextDrawTextSize(LightRedHealth[i], floatadd(484.0, floatdiv(CarHealth, 9.5238095238)),0.000000); | |
| 294 | TextDrawAlignment(LightRedHealth[i],0); | |
| 295 | TextDrawBackgroundColor(LightRedHealth[i],0x000000ff); | |
| 296 | TextDrawFont(LightRedHealth[i],3); | |
| 297 | TextDrawLetterSize(LightRedHealth[i],1.000000,0.199999); | |
| 298 | TextDrawColor(LightRedHealth[i],0xffffffff); | |
| 299 | TextDrawSetOutline(LightRedHealth[i],1); | |
| 300 | TextDrawSetProportional(LightRedHealth[i],1); | |
| 301 | TextDrawSetShadow(LightRedHealth[i],1); | |
| 302 | TextDrawShowForPlayer(i, LightRedHealth[i]); | |
| 303 | LightRedHealthCreated[i] = true; | |
| 304 | if(CarHealth < 250) | |
| 305 | {
| |
| 306 | if(ExclamationShown[i] == true) | |
| 307 | {
| |
| 308 | TextDrawHideForPlayer(i, Text:Exclamation); | |
| 309 | ExclamationShown[i] = false; | |
| 310 | } | |
| 311 | else | |
| 312 | {
| |
| 313 | TextDrawShowForPlayer(i, Text:Exclamation); | |
| 314 | ExclamationShown[i] = true; | |
| 315 | } | |
| 316 | } | |
| 317 | else if(CarHealth > 250) | |
| 318 | {
| |
| 319 | if(ExclamationShown[i] == true) | |
| 320 | {
| |
| 321 | TextDrawHideForPlayer(i, Text:Exclamation); | |
| 322 | ExclamationShown[i] = false; | |
| 323 | } | |
| 324 | } | |
| 325 | ||
| 326 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 327 | ||
| 328 | if(LightYellowSpeedCreated[i] == true) | |
| 329 | {
| |
| 330 | TextDrawDestroy(LightYellowSpeed[i]); | |
| 331 | } | |
| 332 | LightYellowSpeed[i] = TextDrawCreate(537.000000,404.000000,"_"); | |
| 333 | TextDrawUseBox(LightYellowSpeed[i],1); | |
| 334 | TextDrawBoxColor(LightYellowSpeed[i],0xffff0066); | |
| 335 | if(Distance >= 75) | |
| 336 | {
| |
| 337 | TextDrawTextSize(LightYellowSpeed[i],589.000000,0.000000); | |
| 338 | } | |
| 339 | else | |
| 340 | {
| |
| 341 | TextDrawTextSize(LightYellowSpeed[i], floatadd(533.0, floatdiv(Distance, 1.33928571428)),0.000000); | |
| 342 | } | |
| 343 | TextDrawAlignment(LightYellowSpeed[i],0); | |
| 344 | TextDrawBackgroundColor(LightYellowSpeed[i],0x000000ff); | |
| 345 | TextDrawFont(LightYellowSpeed[i],3); | |
| 346 | TextDrawLetterSize(LightYellowSpeed[i],1.000000,1.200000); | |
| 347 | TextDrawColor(LightYellowSpeed[i],0xffffffff); | |
| 348 | TextDrawSetOutline(LightYellowSpeed[i],1); | |
| 349 | TextDrawSetProportional(LightYellowSpeed[i],1); | |
| 350 | TextDrawSetShadow(LightYellowSpeed[i],1); | |
| 351 | TextDrawShowForPlayer(i, LightYellowSpeed[i]); | |
| 352 | LightYellowSpeedCreated[i] = true; | |
| 353 | ||
| 354 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 355 | ||
| 356 | OldX[i] = X; OldY[i] = Y; OldZ[i] = Z; | |
| 357 | ||
| 358 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| 359 | ||
| 360 | } | |
| 361 | else | |
| 362 | {
| |
| 363 | if(TextDrawsShown[i] == true) | |
| 364 | {
| |
| 365 | TextDrawHideForPlayer(i, Text:Black0); | |
| 366 | TextDrawHideForPlayer(i, Text:White1); | |
| 367 | TextDrawHideForPlayer(i, Text:White2); | |
| 368 | TextDrawHideForPlayer(i, Text:White3); | |
| 369 | TextDrawHideForPlayer(i, Text:BlackHealth); | |
| 370 | TextDrawHideForPlayer(i, Text:DarkRedHealth); | |
| 371 | TextDrawHideForPlayer(i, Text:BlackSpeed); | |
| 372 | TextDrawHideForPlayer(i, Text:DarkYellowSpeed); | |
| 373 | TextDrawHideForPlayer(i, Text:Marker); | |
| 374 | TextDrawHideForPlayer(i, Text:Exclamation); | |
| 375 | TextDrawsShown[i] = false; | |
| 376 | } | |
| 377 | TextDrawHideForPlayer(i, Text:VHS[i]); | |
| 378 | TextDrawHideForPlayer(i, Text:LightRedHealth[i]); | |
| 379 | TextDrawHideForPlayer(i, Text:LightYellowSpeed[i]); | |
| 380 | } | |
| 381 | } | |
| 382 | } | |
| 383 | } | |
| 384 | ||
| 385 | public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) | |
| 386 | {
| |
| 387 | return 1; | |
| 388 | } | |
| 389 | ||
| 390 | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) | |
| 391 | {
| |
| 392 | return 1; | |
| 393 | } | |
| 394 | ||
| 395 | public OnRconLoginAttempt(ip[], password[], success) | |
| 396 | {
| |
| 397 | return 1; | |
| 398 | } | |
| 399 | ||
| 400 | public OnPlayerUpdate(playerid) | |
| 401 | {
| |
| 402 | return 1; | |
| 403 | } | |
| 404 | ||
| 405 | public OnPlayerStreamIn(playerid, forplayerid) | |
| 406 | {
| |
| 407 | return 1; | |
| 408 | } | |
| 409 | ||
| 410 | public OnPlayerStreamOut(playerid, forplayerid) | |
| 411 | {
| |
| 412 | return 1; | |
| 413 | } | |
| 414 | ||
| 415 | public OnVehicleStreamIn(vehicleid, forplayerid) | |
| 416 | {
| |
| 417 | return 1; | |
| 418 | } | |
| 419 | ||
| 420 | public OnVehicleStreamOut(vehicleid, forplayerid) | |
| 421 | {
| |
| 422 | return 1; | |
| 423 | } | |
| 424 | ||
| 425 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
| 426 | {
| |
| 427 | if(dialogid == DIALOG_LOGIN) // DIALOG_LOGIN wird abgerufen. | |
| 428 | {
| |
| 429 | if(response == 0) // Der Abbrech Button | |
| 430 | {
| |
| 431 | SendClientMessage(playerid,COLOR_RED,"Du hast den Login Vorgang abgebrochen!"); | |
| 432 | Kick(playerid); // Kickt den Spieler | |
| 433 | return 1; | |
| 434 | } | |
| 435 | if(response == 1) // Der Login Button | |
| 436 | {
| |
| 437 | if(!strlen(inputtext)) | |
| 438 | {
| |
| 439 | SendClientMessage(playerid,COLOR_GREEN,"Dein eingegebenes Passwort war nicht lang genug!"); | |
| 440 | ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Login","Ihr Account wurde in unserer Datenbank gefunden!\nBitte gib nun dein Passwort ein! ","Login", "Abbrechen"); | |
| 441 | return 1; | |
| 442 | } | |
| 443 | else | |
| 444 | {
| |
| 445 | Login(playerid,inputtext); // Diese Funktion erstellen wir gleich | |
| 446 | return 1; | |
| 447 | } | |
| 448 | } | |
| 449 | } | |
| 450 | if(dialogid == DIALOG_REGISTER) // Ruft DIALOG_REGISTER auf | |
| 451 | {
| |
| 452 | if(response == 0) // Der Abbrech Button | |
| 453 | {
| |
| 454 | SendClientMessage(playerid,COLOR_RED,"Sie haben die Registrierung abgebrochen!"); | |
| 455 | Kick(playerid); // Kickt den Spieler | |
| 456 | return 1; | |
| 457 | } | |
| 458 | if(response == 1) // Der Register Button | |
| 459 | {
| |
| 460 | if(!strlen(inputtext)) | |
| 461 | {
| |
| 462 | SendClientMessage(playerid,COLOR_GREEN,"Dein eingegebenes Passwort war nicht lang genug!"); | |
| 463 | ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Registrierung auf DeinRL","Willkommen auf DeinRL City!\nBitte geben sie nun ihr gewünschtes Passwort ein","Register","Abbrechen"); | |
| 464 | return 1; | |
| 465 | } | |
| 466 | else | |
| 467 | {
| |
| 468 | Register(playerid,inputtext); // Funktion wird gleich erstellt. | |
| 469 | return 1; | |
| 470 | } | |
| 471 | } | |
| 472 | } | |
| 473 | return 1; | |
| 474 | } | |
| 475 | ||
| 476 | public OnPlayerClickPlayer(playerid, clickedplayerid, source) | |
| 477 | {
| |
| 478 | return 1; | |
| 479 | } | |
| 480 | ||
| 481 | stock Register(playerid,key[]) | |
| 482 | {
| |
| 483 | new Playerdatei[128]; | |
| 484 | new name[MAX_PLAYER_NAME]; | |
| 485 | GetPlayerName(playerid,name,sizeof(name)); | |
| 486 | format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); | |
| 487 | dini_Create(Playerdatei); | |
| 488 | dini_Set(Playerdatei,"Passwort",key); | |
| 489 | SetPlayerScore(playerid,0); | |
| 490 | dini_IntSet(Playerdatei,"Admin",0); | |
| 491 | SetPVarInt(playerid,"Eingeloggt",1); | |
| 492 | return 1; | |
| 493 | } | |
| 494 | ||
| 495 | stock Login(playerid,key[]) | |
| 496 | {
| |
| 497 | new Playerdatei[128]; | |
| 498 | new name[MAX_PLAYER_NAME]; | |
| 499 | GetPlayerName(playerid,name,sizeof(name)); | |
| 500 | format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); | |
| 501 | if(!strcmp(key,dini_Get(Playerdatei,"Passwort"),false)) | |
| 502 | {
| |
| 503 | AccountLaden(playerid); // Machen wir gleich! | |
| 504 | } | |
| 505 | else | |
| 506 | {
| |
| 507 | SendClientMessage(playerid,COLOR_GREEN,"Du hast ein falsches Passwort eingegeben!"); | |
| 508 | ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Login","Dein Account wurde in unserer Datenbank gefunden!\nBitte gib nun dein Passwort ein! ","Login", "Abbrechen"); | |
| 509 | } | |
| 510 | return 1; | |
| 511 | } | |
| 512 | ||
| 513 | stock AccountLaden(playerid) | |
| 514 | {
| |
| 515 | new Playerdatei[128]; | |
| 516 | new name[MAX_PLAYER_NAME]; | |
| 517 | GetPlayerName(playerid,name,sizeof(name)); | |
| 518 | format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); | |
| 519 | Spieler[playerid][Level] = dini_Int(Playerdatei,"Level"); | |
| 520 | Spieler[playerid][Admin] = dini_Int(Playerdatei,"Admin"); | |
| 521 | SetPVarInt(playerid,"Eingeloggt",1); | |
| 522 | return 1; | |
| 523 | } | |
| 524 | ||
| 525 | stock SpielerSpeichern(playerid) | |
| 526 | {
| |
| 527 | if(GetPVarInt(playerid,"Eingeloggt") == 1) | |
| 528 | {
| |
| 529 | new Playerdatei[128]; | |
| 530 | new name[MAX_PLAYER_NAME]; | |
| 531 | GetPlayerName(playerid,name,sizeof(name)); | |
| 532 | format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); | |
| 533 | dini_IntSet(Playerdatei,"Level", Spieler[playerid][Level]); | |
| 534 | dini_IntSet(Playerdatei, "Admin", Spieler[playerid][Admin]); | |
| 535 | } | |
| 536 | } |