#include #define COLOR_YELLOW 0xFFFF00AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_WHITE 0xFFFFFFAA #define GasMax 100 #define RunOutTime 1000 #define RefuelWait 5000 #define CAR_AMOUNT 100 new Gas[CAR_AMOUNT]; new Refueling[MAX_PLAYERS]; enum SavePlayerPosEnum { Float:LastX, Float:LastY, Float:LastZ } new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum]; new SpeedMode = 1; new UpdateSeconds = 1; #define MAX_POINTS 19 #define CP_1 0 #define CP_2 1 #define CP_3 2 #define CP_4 3 #define CP_5 4 #define CP_6 5 #define CP_7 6 #define CP_8 7 #define CP_9 8 #define CP_10 9 #define CP_11 10 #define CP_12 11 #define CP_13 12 #define CP_14 13 #define CP_15 14 #define CP_16 15 #define CP_17 16 #define CP_18 17 #define CP_19 18 new playerCheckpoint[MAX_PLAYERS]; new Float:checkCoords[MAX_POINTS][4] = { {2098.1316,901.7380,2137.7456,963.0146}, {2617.5967,1062.8710,2656.6526,1142.5109}, {501.7475,1626.7821,653.2095,1774.1093}, {-1351.2833,2638.8943,-1265.1661,2738.6450}, {-2450.3767,949.5080,-2400.8530,1069.8329}, {-1715.5112,349.5567,-1658.8451,458.3686}, {-2265.3027,-2586.3762,-2219.1868,-2558.2539}, {-1657.4102,-2763.3518,-1501.5303,-2666.7454}, {1903.7450,-1795.7990,1955.5667,-1759.5187}, {-135.2077,-1199.8291,-43.7008,-1134.7999}, {1336.7378,454.7961,1430.0760,483.9776}, {648.2494,-592.9003,670.9278,-540.8264}, {-1494.2593,1854.1290,-1449.4076,1885.2032}, {2097.0452,2708.1218,2172.7161,2762.7495}, {2187.6587,2462.8057,2215.5042,2495.0332}, {1577.7729,2182.5112,1616.5842,2242.3628}, {1988.03, -2321.34, 13.55,4.0}, {1287.82, 1418.37, 10.96,4.0}, {-1262.37, 67.92, 14.32,4.0} }; new Float:checkpoints[MAX_POINTS][4] = { {2109.2126,917.5845,10.8203,5.0}, {2640.1831,1103.9224,10.8203,5.0}, {611.8934,1694.7921,6.7193,5.0}, {-1327.5398,2682.9771,49.7896,5.0}, {-2413.7427,975.9317,45.0031,5.0}, {-1672.3597,414.2950,6.8866,5.0}, {-2244.1365,-2560.6294,31.6276,5.0}, {-1603.0166,-2709.3589,48.2419,5.0}, {1939.3275,-1767.6813,13.2787,5.0}, {-94.7651,-1174.8079,1.9979,5.0}, {1381.6699,462.6467,19.8540,5.0}, {657.8167,-559.6507,16.0630,5.0}, {-1478.2916,1862.8318,32.3617,5.0}, {2147.3054,2744.9377,10.5263,5.0}, {2204.9602,2480.3494,10.5278,5.0}, {1590.9493,2202.2637,10.5247,5.0}, {1988.03,-2321.34,13.55,5.0}, {1287.82, 1418.37 ,10.96,5.0}, {-1262.37, 67.92, 14.32} }; new checkpointType[MAX_POINTS] = { CP_1, CP_2, CP_3, CP_4, CP_5, CP_6, CP_7, CP_8, CP_9, CP_10, CP_11, CP_12, CP_13, CP_14, CP_15, CP_16, CP_17, CP_18, CP_19 }; forward public getCheckpointType(playerID); forward public isPlayerInArea(playerID, Float:data[4]); forward public CheckGas(); forward public checkpointUpdate(); forward public FuelRefill(playerid); forward public Fillup(); forward public StoppedVehicle(); main() { print("\n----------------------------------"); print(" Gas and Speed"); print("----------------------------------\n"); } public getCheckpointType(playerID) { return checkpointType[playerCheckpoint[playerID]]; } public isPlayerInArea(playerID, Float:data[4]) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerID, X, Y, Z); if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) { } return 0; } public CheckGas() { new string[256]; for(new i=0;i= 1) { format(string, sizeof(string), "Gas Left %d",Gas[GetPlayerVehicleID(i)]); SendClientMessage(i,COLOR_YELLOW,string); Gas[GetPlayerVehicleID(i)]--; } else { RemovePlayerFromVehicle(i); GameTextForPlayer(i,"~w~No Gas In ~r~Vehicle",1000,1); } } } return 1; } public checkpointUpdate() { for(new i=0; i= FillUp) { new mess[64]; format(mess, sizeof(mess), "* Type /Fillup To Re-Fuel Your Car"); SendClientMessage(playerid, COLOR_YELLOW, mess); } } } public OnGameModeInit() { //("GameModeInit()"); SetGameModeText("Gas and Speed"); for(new c=0;c= FillUp+4) { if(Refueling[i] == 1) { Gas[VID] +=FillUp; format(string,sizeof(string),"* Vehicle Re-Fueled, Gallons = %d *",FillUp); SendClientMessage(i,COLOR_YELLOW,string); format(string,sizeof(string),"~w~| Re-Fueled ~n~Gallons ~g~%d |",FillUp); GameTextForPlayer(i,string,10,1); GivePlayerMoney(i,-FillUp-1); Refueling[i] = 0; } else { SendClientMessage(i,COLOR_YELLOW,"* Not Enough Money To Re-Fuel *"); } } } } public StoppedVehicle() { new Float:x,Float:y,Float:z; new Float:distance,value; for(new i=0; i 1){ value = floatround(value / UpdateSeconds); } if(SpeedMode){ } if(value == 0) { Gas[VID]++; } SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } } } }