#include #include new Filling[MAX_PLAYERS]; main() { print("\n----------------------------------"); print(" xGas_Example Script by Pixels^"); print("----------------------------------\n"); } public OnGameModeInit() { print("GameModeInit()"); SetGameModeText("xGas_Example"); xGas_SetAllGas(100); SetTimer("Fuel",1000,1); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1954.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnGameModeExit() { return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid) { return 1; } public OnPlayerSpawn(playerid) { for(new v=0; v= 1) { SendClientMessage(playerid,0xFF0000AA,"Not enough money to refuel"); return 1; } Filling[playerid] = 1; SendClientMessage(playerid,0xFFFFFFAA,"Filling vehicle"); return 1; } return 0; } public OnPlayerInfoChange(playerid) { return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public Fuel() { for(new i=0; i= 1) { if(xGas_GetGas(v) >= 100) { SendClientMessage(i,0xFF0000AA,"Vehicle refueled"); return Filling[i] = 0; } xGas_Fuel(v); format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~w~Fuel %d",xGas_GetGas(v)); return GameTextForPlayer(i,string,2000,1); } xGas_Deplete(v); format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~w~Fuel %d",xGas_GetGas(v)); GameTextForPlayer(i,string,2000,1); } } return 1; }