/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////Speedo By Mirgo//////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include #define GasMax 100 #define RunOutTime 30000 #define RefuelWait 5000 #define CAR_AMOUNT 700 #define SpeedoTime 500 #define COLOR_RED 0xFF0000FF #define COLOR_YELLOW 0xFFFF00AA /*forwards*/ forward UpdateSpeedo(); forward CheckGas(); forward Fillup(); forward SpeedoMeter(); forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); /*new´s*/ new Text:SpeedoBox, Text:SpeedoVehText, Text:SpeedoVeh[MAX_PLAYERS], Text:SpeedoKMHText, Text:SpeedoKMH[MAX_PLAYERS],Text:SpeedoTankText, Text:SpeedoTank[MAX_PLAYERS]; new Gas[CAR_AMOUNT],Float:TachoX[MAX_PLAYERS],Float:TachoY[MAX_PLAYERS],Float:TachoZ[MAX_PLAYERS]; new Vozila[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car", "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "2. Gebrauchtwagen", "1. Gebrauchtwagen", "Luggage", "Luggage", "Stairs", "Boxville", "Tiller", "Utility Trailer" }; public OnFilterScriptInit() { /*Textdraws*/ SpeedoBox = TextDrawCreate(623.000000, 324.000000, " ."); TextDrawBackgroundColor(SpeedoBox, 255); TextDrawFont(SpeedoBox, 1); TextDrawLetterSize(SpeedoBox, 27.410072, 1.000000); TextDrawColor(SpeedoBox, -1); TextDrawSetOutline(SpeedoBox, 0); TextDrawSetProportional(SpeedoBox, 1); TextDrawSetShadow(SpeedoBox, 1); TextDrawUseBox(SpeedoBox, 1); TextDrawBoxColor(SpeedoBox, 50); TextDrawTextSize(SpeedoBox, 511.000000, -7.000000); SpeedoVehText = TextDrawCreate(516.000000, 322.000000, "Vozilo:"); TextDrawBackgroundColor(SpeedoVehText, 255); TextDrawFont(SpeedoVehText, 2); TextDrawLetterSize(SpeedoVehText, 0.320000, 1.000000); TextDrawColor(SpeedoVehText, 75366399); TextDrawSetOutline(SpeedoVehText, 1); TextDrawSetProportional(SpeedoVehText, 1); SpeedoTankText = TextDrawCreate(516.000000, 376.000000, "Gorivo:"); TextDrawBackgroundColor(SpeedoTankText, 255); TextDrawFont(SpeedoTankText, 2); TextDrawLetterSize(SpeedoTankText, 0.320000, 1.000000); TextDrawColor(SpeedoTankText, 75366399); TextDrawSetOutline(SpeedoTankText, 1); TextDrawSetProportional(SpeedoTankText, 1); SpeedoKMHText = TextDrawCreate(516.000000, 349.000000, "KM/H:"); TextDrawBackgroundColor(SpeedoKMHText, 255); TextDrawFont(SpeedoKMHText, 2); TextDrawLetterSize(SpeedoKMHText, 0.320000, 1.000000); TextDrawColor(SpeedoKMHText, 75366399); TextDrawSetOutline(SpeedoKMHText, 1); TextDrawSetProportional(SpeedoKMHText, 1); for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { SpeedoVeh[playerid] = TextDrawCreate(516.000000, 333.000000, " "); TextDrawBackgroundColor(SpeedoVeh[playerid], 255); TextDrawFont(SpeedoVeh[playerid], 2); TextDrawLetterSize(SpeedoVeh[playerid], 0.320000, 1.000000); TextDrawColor(SpeedoVeh[playerid], -1); TextDrawSetOutline(SpeedoVeh[playerid], 1); TextDrawSetProportional(SpeedoVeh[playerid], 1); SpeedoKMH[playerid] = TextDrawCreate(516.000000, 360.000000, " "); TextDrawBackgroundColor(SpeedoKMH[playerid], 255); TextDrawFont(SpeedoKMH[playerid], 2); TextDrawLetterSize(SpeedoKMH[playerid], 0.320000, 1.000000); TextDrawColor(SpeedoKMH[playerid], -1); TextDrawSetOutline(SpeedoKMH[playerid], 1); TextDrawSetProportional(SpeedoKMH[playerid], 1); SpeedoTank[playerid] = TextDrawCreate(516.000000, 387.000000, " "); TextDrawBackgroundColor(SpeedoTank[playerid], 255); TextDrawFont(SpeedoTank[playerid], 2); TextDrawLetterSize(SpeedoTank[playerid], 0.320000, 1.000000); TextDrawColor(SpeedoTank[playerid], -1); TextDrawSetOutline(SpeedoTank[playerid], 1); TextDrawSetProportional(SpeedoTank[playerid], 1); } /*Timer*/ SetTimer("UpdateSpeedo",1000,1); SetTimer("SpeedoMeter",1000,1); SetTimer("CheckGas",20000,1); for(new c = 0; c < CAR_AMOUNT; c++) { Gas[c] = GasMax; } return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { TextDrawShowForPlayer(playerid,SpeedoBox); TextDrawShowForPlayer(playerid,SpeedoVehText); TextDrawShowForPlayer(playerid,SpeedoVeh[playerid]); TextDrawShowForPlayer(playerid,SpeedoKMHText); TextDrawShowForPlayer(playerid,SpeedoKMH[playerid]); TextDrawShowForPlayer(playerid,SpeedoTankText); TextDrawShowForPlayer(playerid,SpeedoTank[playerid]); } if(oldstate == PLAYER_STATE_DRIVER) { TextDrawHideForPlayer(playerid,SpeedoBox); TextDrawHideForPlayer(playerid,SpeedoVehText); TextDrawHideForPlayer(playerid,SpeedoVeh[playerid]); TextDrawHideForPlayer(playerid,SpeedoKMHText); TextDrawHideForPlayer(playerid,SpeedoKMH[playerid]); TextDrawHideForPlayer(playerid,SpeedoTankText); TextDrawHideForPlayer(playerid, SpeedoTank[playerid]); } return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public UpdateSpeedo() { for(new i = 0;i -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; } public CheckGas() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == 2) { new vehicle = GetPlayerVehicleID(i); if(Gas[vehicle] >= 1) { if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); } Gas[vehicle]--; } else { TogglePlayerControllable(i, 0); GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~r~Tvoj rezervoraj je prazan!~n~~w~/exit da izadete", 5000, 3); } } } } return 1; }