PHP код:
#include <streamer>
forward FuelConsumptionLow();
forward RefillFuel(playerid);
new Fuel[MAX_VEHICLES];
new FuelCheckpoint[MAX_PLAYERS];
new FuelTimer;
new FuelRefillTimer;
new Menu:GasMenu;
new Menu:FuelPayMent;
new RefillingFuel[MAX_PLAYERS];
enum pInfo
{
//--[Payment Method]
pPayByVisa,
pPayByCash,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
main()
{
//--[Fuel Payment]
FuelPayMent = CreateMenu("~w~Gas ~r~Station",1,50,220,200,230);
SetMenuColumnHeader(FuelPayMent, 0, "Select Payment");
AddMenuItem(FuelPayMent,0,"Visa Debit");
AddMenuItem(FuelPayMent,0,"Cash");
AddMenuItem(FuelPayMent,0,"Cancel");
//--[Fuel Pick]
GasMenu = CreateMenu("~w~Gas ~r~Station",1,50,220,200,230);
SetMenuColumnHeader(GasMenu, 0, "Select A Fuel");
AddMenuItem(GasMenu,0,"Unleaded 95");
AddMenuItem(GasMenu,0,"Super Unleaded 97");
AddMenuItem(GasMenu,0,"Diesel");
AddMenuItem(GasMenu,0,"Natural Gas");
AddMenuItem(GasMenu,0,"Exit");
//---[TextDraws]
//--[Fuel]
for(new playerid = 0;playerid < GetMaxPlayers();playerid++){
FuelTxt[playerid] = TextDrawCreate(0,410,"Fuel:%i%");
TextDrawBackgroundColor(FuelTxt[playerid],0x00000033);
TextDrawFont(FuelTxt[playerid],3);
TextDrawLetterSize(FuelTxt[playerid],0.399999,1.700000);
TextDrawColor(FuelTxt[playerid],0xFFFFFFFF);
TextDrawSetShadow(FuelTxt[playerid],3);}
}
public FuelConsumptionLow()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new vehicleid = GetPlayerVehicleID(i);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPlayerVehicleSeat(i) == 0)
{
Fuel[vehicleid]--;
if(Fuel[vehicleid]<= 0)
{
Fuel[vehicleid] = 0;
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
VehicleInfo[vehicleid][vEngine] = 0;
GameTextForPlayer(i,"~w~You Are Out Of ~r~Fuel~w~!",5000,4);
}
}
new string[125];
format(string,sizeof string,"Fuel:%i%",Fuel[vehicleid]);
TextDrawSetString(FuelTxt[i],string);
}
return 1;
}
public RefillFuel(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
if(RefillingFuel[playerid] == 1)
{
if(Fuel[vehicleid] < 100)
{
Fuel[vehicleid] = 100;
RefillingFuel[playerid] = 0;
KillTimer(FuelRefillTimer);
TogglePlayerControllable(playerid, 0);
}
}
new string[128];
format(string,sizeof string,"Fuel:%i%",Fuel[vehicleid]);
TextDrawSetString(FuelTxt[playerid],string);
KillTimer(FuelRefillTimer);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
return 1;
}
public OnGameModeInit()
{
//--[Fuel]
for(new i=0;i<MAX_VEHICLES;i++)
{
Fuel[i] = 100;
}
return 1;
}
public OnPlayerDeath(playerid)
{
TextDrawHideForPlayer(playerid,FuelTxt[playerid]);
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == Checkpoint[0]||checkpointid == FuelCheckpoint[1]||checkpointid == FuelCheckpoint[2]||checkpointid == FuelCheckpoint[3]||checkpointid == FuelCheckpoint[4]||checkpointid == FuelCheckpoint[5]||checkpointid == FuelCheckpoint[6]||checkpointid == FuelCheckpoint[7]||checkpointid == FuelCheckpoint[8]||checkpointid == FuelCheckpoint[9]||checkpointid == FuelCheckpoint[10]||checkpointid == FuelCheckpoint[11])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[12]||checkpointid == FuelCheckpoint[13]||checkpointid == FuelCheckpoint[14]||checkpointid == FuelCheckpoint[15]||checkpointid == FuelCheckpoint[16]||checkpointid == FuelCheckpoint[17]||checkpointid == FuelCheckpoint[18]||checkpointid == FuelCheckpoint[19]||checkpointid == FuelCheckpoint[20]||checkpointid == FuelCheckpoint[21]||checkpointid == FuelCheckpoint[22]||checkpointid == FuelCheckpoint[23])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[24]||checkpointid == FuelCheckpoint[25]||checkpointid == FuelCheckpoint[26]||checkpointid == FuelCheckpoint[27]||checkpointid == FuelCheckpoint[28]||checkpointid == FuelCheckpoint[29]||checkpointid == FuelCheckpoint[30]||checkpointid == FuelCheckpoint[31]||checkpointid == FuelCheckpoint[32]||checkpointid == FuelCheckpoint[33]||checkpointid == FuelCheckpoint[34]||checkpointid == FuelCheckpoint[35])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[36]||checkpointid == FuelCheckpoint[37]||checkpointid == FuelCheckpoint[38]||checkpointid == FuelCheckpoint[39]||checkpointid == FuelCheckpoint[40]||checkpointid == FuelCheckpoint[41]||checkpointid == FuelCheckpoint[42]||checkpointid == FuelCheckpoint[43]||checkpointid == FuelCheckpoint[44]||checkpointid == FuelCheckpoint[45]||checkpointid == FuelCheckpoint[46]||checkpointid == FuelCheckpoint[47])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[48]||checkpointid == FuelCheckpoint[49]||checkpointid == FuelCheckpoint[50]||checkpointid == FuelCheckpoint[51]||checkpointid == FuelCheckpoint[52]||checkpointid == FuelCheckpoint[53]||checkpointid == FuelCheckpoint[54]||checkpointid == FuelCheckpoint[55]||checkpointid == FuelCheckpoint[56]||checkpointid == FuelCheckpoint[57]||checkpointid == FuelCheckpoint[58]||checkpointid == FuelCheckpoint[59])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[60]||checkpointid == FuelCheckpoint[61]||checkpointid == FuelCheckpoint[62]||checkpointid == FuelCheckpoint[63]||checkpointid == FuelCheckpoint[64]||checkpointid == FuelCheckpoint[65]||checkpointid == FuelCheckpoint[66]||checkpointid == FuelCheckpoint[67]||checkpointid == FuelCheckpoint[68]||checkpointid == FuelCheckpoint[69]||checkpointid == FuelCheckpoint[70]||checkpointid == FuelCheckpoint[71])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[72]||checkpointid == FuelCheckpoint[73]||checkpointid == FuelCheckpoint[74]||checkpointid == FuelCheckpoint[75]||checkpointid == FuelCheckpoint[76]||checkpointid == FuelCheckpoint[77]||checkpointid == FuelCheckpoint[78]||checkpointid == FuelCheckpoint[79]||checkpointid == FuelCheckpoint[80]||checkpointid == FuelCheckpoint[81]||checkpointid == FuelCheckpoint[82]||checkpointid == FuelCheckpoint[83])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[84]||checkpointid == FuelCheckpoint[85]||checkpointid == FuelCheckpoint[86]||checkpointid == FuelCheckpoint[87]||checkpointid == FuelCheckpoint[88]||checkpointid == FuelCheckpoint[89]||checkpointid == FuelCheckpoint[90]||checkpointid == FuelCheckpoint[91]||checkpointid == FuelCheckpoint[92]||checkpointid == FuelCheckpoint[93]||checkpointid == FuelCheckpoint[94]||checkpointid == FuelCheckpoint[95])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
if(checkpointid == FuelCheckpoint[96]||checkpointid == FuelCheckpoint[97]||checkpointid == FuelCheckpoint[98])
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],string2[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Your Visa Balance is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
format(string2,sizeof(string2),COLOR_WHITE"Thats If You Want To Pay By Visa To Purchase Fuel.");
SendClientMessage(playerid,-1, string);
SendClientMessage(playerid,-1, string2);
ShowMenuForPlayer(FuelPayMent,playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Are Not In A Vehicle !!");
}
}
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)///this is not yet completed as ive not had the time but the first 5 are correct just change the values also haven't added vehicle info on electric petrol or diesel enum to the correct values on vehicle.ide on gta sa directory
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == FuelPayMent)
{
switch(row)
{
case 0:
{
PlayerInfo[playerid][pPayByVisa] = 1;
ShowMenuForPlayer(GasMenu, playerid);
}
case 1:
{
PlayerInfo[playerid][pPayByCash] = 1;
ShowMenuForPlayer(GasMenu, playerid);
}
case 2:
{
HideMenuForPlayer(FuelPayMent,playerid);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
}
if(current == GasMenu)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, doors, alarm, bonnet, boot, objective;
switch(row)
{
case 0:
{
if(PlayerInfo[playerid][pPayByCash] == 1)
{
if(Fuel[vehicleid] >= 100)
{
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Your Fuel Tank Is Full !!");
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 95 && Fuel[vehicleid] < 100)
{
if(GetPlayerMoney(playerid) >= 1)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have"COLOR_GREEN" $1"COLOR_WHITE" In Your Wallet.");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
else if(Fuel[vehicleid] >= 85 && Fuel[vehicleid] <= 94)
{
if(GetPlayerMoney(playerid) >= 6)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -6);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have"COLOR_GREEN" $6"COLOR_WHITE" In Your Wallet.");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
else if(Fuel[vehicleid] >= 75 && Fuel[vehicleid] < 85)
{
if(GetPlayerMoney(playerid) >= 11)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -11);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have"COLOR_GREEN" $11"COLOR_WHITE" In Your Wallet.");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
else if(Fuel[vehicleid] >= 65 || Fuel[vehicleid] < 75)
{
if(GetPlayerMoney(playerid) >= 16)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -16);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have"COLOR_GREEN" $16"COLOR_WHITE" In Your Wallet.");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
else if(Fuel[vehicleid] >= 55 || Fuel[vehicleid] < 65)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -21);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 45 || Fuel[vehicleid] < 55)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -27);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 35 || Fuel[vehicleid] < 45)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -33);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 25 || Fuel[vehicleid] < 35)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -39);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 15 || Fuel[vehicleid] < 25)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -45);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 0 || Fuel[vehicleid] < 15)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -51);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have Enough Cash !");
PlayerInfo[playerid][pPayByCash] = 0;
}
}
if(PlayerInfo[playerid][pPayByVisa] == 1)
{
if(Fuel[vehicleid] >= 100)
{
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Your Fuel Tank Is Full !!");
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
else if(Fuel[vehicleid] >= 95 && Fuel[vehicleid] < 100)
{
if(PlayerInfo[playerid][pBankAccount] >= 1)
{
RefillingFuel[playerid] = 1;
PlayerInfo[playerid][pBankAccount] -= 1;
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByVisa] = 0;
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player-Data");
INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
INI_Close(File);
}
new string[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Transaction Successfull, Your New Bank Balance Is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
SendClientMessage(playerid,-1,string);
}
}
else if(Fuel[vehicleid] >= 85 && Fuel[vehicleid] <= 94)
{
if(PlayerInfo[playerid][pBankAccount] >= 6)
{
RefillingFuel[playerid] = 1;
PlayerInfo[playerid][pBankAccount] -= 6;
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByVisa] = 0;
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player-Data");
INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
INI_Close(File);
}
new string[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Transaction Successfull, Your New Bank Balance Is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
SendClientMessage(playerid,-1,string);
}
}
else if(Fuel[vehicleid] >= 75 || Fuel[vehicleid] < 85)
{
if(PlayerInfo[playerid][pBankAccount] >= 6)
{
RefillingFuel[playerid] = 1;
PlayerInfo[playerid][pBankAccount] -= 11;
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByVisa] = 0;
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player-Data");
INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
INI_Close(File);
}
new string[128];
format(string,sizeof(string),COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" Transaction Successfull, Your New Bank Balance Is:"COLOR_GREEN" $%d"COLOR_WHITE".",PlayerInfo[playerid][pBankAccount]);
SendClientMessage(playerid,-1,string);
}
}
else if(Fuel[vehicleid] >= 65 || Fuel[vehicleid] < 75)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -16);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 55 || Fuel[vehicleid] < 65)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -21);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 45 || Fuel[vehicleid] < 55)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -27);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 35 || Fuel[vehicleid] < 45)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -33);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 25 || Fuel[vehicleid] < 35)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -39);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 15 || Fuel[vehicleid] < 25)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -45);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
PlayerInfo[playerid][pPayByCash] = 0;
}
else if(Fuel[vehicleid] >= 0 || Fuel[vehicleid] < 15)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -51);
GameTextForPlayer(playerid,"~r~Unleadead 95 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
VehicleInfo[vehicleid][vEngine] = 0;
SetVehicleParamsEx(vehicleid,0,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
PlayerInfo[playerid][pPayByCash] = 0;
}
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 60)
{
if(Fuel[vehicleid] >= 100)
{
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Your Fuel Tank Is Full !!");
}
if(Fuel[vehicleid] < 100)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -60);
GameTextForPlayer(playerid,"~r~Super Unleadead 97 ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
VehicleInfo[vehicleid][vEngine] = 0;
engine = 0;
SetVehicleParamsEx(vehicleid,engine,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
}
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have Enough Cash !");
}
}
case 2:
{
if(GetPlayerMoney(playerid) >= 60)
{
if(Fuel[vehicleid] >= 100)
{
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Your Fuel Tank Is Full !!");
}
if(Fuel[vehicleid] < 100)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -60);
GameTextForPlayer(playerid,"~r~Diesel ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
VehicleInfo[vehicleid][vEngine] = 0;
engine = 0;
SetVehicleParamsEx(vehicleid,engine,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
}
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have Enough Cash !");
}
}
case 3:
{
if(GetPlayerMoney(playerid) >= 60)
{
if(Fuel[vehicleid] >= 100)
{
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Your Fuel Tank Is Full !!");
}
if(Fuel[vehicleid] < 100)
{
RefillingFuel[playerid] = 1;
GivePlayerMoney(playerid, -60);
GameTextForPlayer(playerid,"~r~Natural Gas ~n~ ~w~Refueling Vehicle ~n~ ~g~Please Wait...",4000,3);
FuelRefillTimer = SetTimerEx("RefillFuel",2000,1,"i",playerid);
VehicleInfo[vehicleid][vEngine] = 0;
engine = 0;
SetVehicleParamsEx(vehicleid,engine,lights,doors,alarm,bonnet,boot,objective);
KillTimer(FuelTimer);
}
}
else
{
TogglePlayerControllable(playerid, 1);
RefillingFuel[playerid] = 0;
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Player Info>>"COLOR_WHITE" You Don't Have Enough Cash !");
}
}
case 4:
{
HideMenuForPlayer(GasMenu,playerid);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
GameTextForPlayer(playerid,"~w~You Can Now Turn On Ignition ~n~ To Turn On Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~!",3000,4);
}
}
TogglePlayerControllable(playerid,1);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
//--[Fuel]
FuelCheckpoint[0] = CreateDynamicCP(2108.7808,927.2892,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[1] = CreateDynamicCP(2114.3733,926.6577,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[2] = CreateDynamicCP(2120.9197,927.8914,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[3] = CreateDynamicCP(2120.9055,923.4056,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[4] = CreateDynamicCP(2115.0183,923.2924,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[5] = CreateDynamicCP(2109.3677,923.4417,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[6] = CreateDynamicCP(2108.7913,916.6863,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[7] = CreateDynamicCP(2114.2791,917.0167,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[8] = CreateDynamicCP(2119.9773,916.3806,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[9] = CreateDynamicCP(2121.1189,912.7866,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[10] = CreateDynamicCP(2115.1331,912.8631,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[11] = CreateDynamicCP(2109.2546,913.0229,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[12] = CreateDynamicCP(2634.1892,1114.1205,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[13] = CreateDynamicCP(2639.0669,1113.9657,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[14] = CreateDynamicCP(2644.7126,1113.3190,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[15] = CreateDynamicCP(2645.2688,1110.0897,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[16] = CreateDynamicCP(2640.2148,1109.9452,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[17] = CreateDynamicCP(2634.1799,1109.6874,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[18] = CreateDynamicCP(2634.4658,1102.8927,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[19] = CreateDynamicCP(2639.2800,1102.5261,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[20] = CreateDynamicCP(2645.1858,1102.3428,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[21] = CreateDynamicCP(2645.5928,1098.9929,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[22] = CreateDynamicCP(2640.2700,1099.2267,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[23] = CreateDynamicCP(2634.8308,1099.2721,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[24] = CreateDynamicCP(2195.2927,2470.0906,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[25] = CreateDynamicCP(2195.4221,2474.5916,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[26] = CreateDynamicCP(2195.3494,2480.1204,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[27] = CreateDynamicCP(2198.1458,2480.2900,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[28] = CreateDynamicCP(2198.3857,2474.9087,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[29] = CreateDynamicCP(2198.1028,2470.2695,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[30] = CreateDynamicCP(2206.0237,2470.1619,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[31] = CreateDynamicCP(2206.4529,2473.9092,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[32] = CreateDynamicCP(2206.5405,2479.7046,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[33] = CreateDynamicCP(2634.8308,1099.2721,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[34] = CreateDynamicCP(2208.6667,2480.8679,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[35] = CreateDynamicCP(2209.1143,2474.8806,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[36] = CreateDynamicCP(2208.7407,2470.3989,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[37] = CreateDynamicCP(2153.5828,2741.1687,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[38] = CreateDynamicCP(2147.6658,2741.0576,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[39] = CreateDynamicCP(2142.3901,2741.2117,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[40] = CreateDynamicCP(2141.6956,2743.8687,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[41] = CreateDynamicCP(2147.6206,2744.1465,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[42] = CreateDynamicCP(2153.5920,2744.0486,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[43] = CreateDynamicCP(2153.4204,2751.2065,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[44] = CreateDynamicCP(2147.7434,2751.8328,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[45] = CreateDynamicCP(2141.6116,2751.7439,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[46] = CreateDynamicCP(2141.8179,2755.1025,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[47] = CreateDynamicCP(2147.2407,2754.7571,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[48] = CreateDynamicCP(2153.2368,2754.5857,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[49] = CreateDynamicCP(1602.4869,2206.2961,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[50] = CreateDynamicCP(1596.6930,2206.2192,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[51] = CreateDynamicCP(1590.5864,2205.8420,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[52] = CreateDynamicCP(1590.0883,2203.2332,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[53] = CreateDynamicCP(1595.6864,2203.0886,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[54] = CreateDynamicCP(1601.5751,2203.3127,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[55] = CreateDynamicCP(1601.8931,2195.5793,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[56] = CreateDynamicCP(1596.0645,2195.0261,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[57] = CreateDynamicCP(1590.2952,2194.8159,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[58] = CreateDynamicCP(1590.0046,2192.4124,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[59] = CreateDynamicCP(1595.7502,2192.4153,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[60] = CreateDynamicCP(1602.0670,2192.3350,10.8203,3.0,0,0,-1,5.0);
FuelCheckpoint[61] = CreateDynamicCP(-1477.2898,1856.8906,32.6398,3.0,0,0,-1,5.0);
FuelCheckpoint[62] = CreateDynamicCP(-1465.2904,1859.3123,32.6328,3.0,0,0,-1,5.0);
FuelCheckpoint[63] = CreateDynamicCP(-1464.9656,1862.3068,32.6398,3.0,0,0,-1,5.0);
FuelCheckpoint[64] = CreateDynamicCP(-1477.6771,1865.8319,32.6398,3.0,0,0,-1,5.0);
FuelCheckpoint[65] = CreateDynamicCP(-1465.3917,1866.6824,32.6328,3.0,0,0,-1,5.0);
FuelCheckpoint[66] = CreateDynamicCP(-1465.3975,1869.5880,32.6328,3.0,0,0,-1,5.0);
FuelCheckpoint[67] = CreateDynamicCP(-1478.0535,1868.8499,32.6328,3.0,0,0,-1,5.0);
FuelCheckpoint[68] = CreateDynamicCP(-1326.7760,2686.8931,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[69] = CreateDynamicCP(-1327.0586,2684.1975,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[70] = CreateDynamicCP(-1327.4729,2681.3140,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[71] = CreateDynamicCP(-1327.8630,2679.1577,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[72] = CreateDynamicCP(-1328.4803,2675.4961,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[73] = CreateDynamicCP(-1328.5684,2673.8777,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[74] = CreateDynamicCP(-1329.0122,2670.0313,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[75] = CreateDynamicCP(-1329.4550,2668.4976,50.0625,3.0,0,0,-1,5.0);
FuelCheckpoint[76] = CreateDynamicCP(-2409.1660,970.1500,45.3016,3.0,0,0,-1,5.0);
FuelCheckpoint[77] = CreateDynamicCP(-2409.0400,975.6674,45.2969,3.0,0,0,-1,5.0);
FuelCheckpoint[78] = CreateDynamicCP(-2409.1587,980.9697,45.2969,3.0,0,0,-1,5.0);
FuelCheckpoint[79] = CreateDynamicCP(-2412.8457,981.9281,45.2969,3.0,0,0,-1,5.0);
FuelCheckpoint[80] = CreateDynamicCP(-2412.7693,976.5505,45.2969,3.0,0,0,-1,5.0);
FuelCheckpoint[81] = CreateDynamicCP(-2413.0659,971.2130,45.2969,3.0,0,0,-1,5.0);
FuelCheckpoint[82] = CreateDynamicCP(-1664.1681,416.2672,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[83] = CreateDynamicCP(-1668.8328,411.5138,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[84] = CreateDynamicCP(-1673.9806,406.2597,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[85] = CreateDynamicCP(-1677.8134,402.3348,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[86] = CreateDynamicCP(-1680.4927,404.0694,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[87] = CreateDynamicCP(-1676.1893,408.0239,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[88] = CreateDynamicCP(-1670.9512,413.0762,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[89] = CreateDynamicCP(-1666.9934,417.4710,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[90] = CreateDynamicCP(-1670.4814,422.1657,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[91] = CreateDynamicCP(-1675.3580,418.4229,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[92] = CreateDynamicCP(-1680.9493,413.0178,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[93] = CreateDynamicCP(-1685.4596,408.2812,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[94] = CreateDynamicCP(-1686.8375,410.8939,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[95] = CreateDynamicCP(-1682.7776,414.7359,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[96] = CreateDynamicCP(-1677.3827,419.9156,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[97] = CreateDynamicCP(-1673.2299,424.4374,7.1797,3.0,0,0,-1,5.0);
FuelCheckpoint[98] = CreateDynamicCP(-1478.3348,1861.4565,32.6328,3.0,0,0,-1,5.0);
return 1;
}
public OnPlayerUpdate(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Fuel[vehicleid]<= 10)
{
//--[Fuel]
//-[Garage1]
SetPlayerMapIcon(playerid, 66,2112.1772,918.1446,10.4451,55,0,MAPICON_GLOBAL);
//-[Garage2]
SetPlayerMapIcon(playerid, 67,2640.4646,1102.7355,10.8203,55,0,MAPICON_GLOBAL);
//-[Garage3]
SetPlayerMapIcon(playerid, 68,2201.8408,2475.9265,10.8203,55,0,MAPICON_GLOBAL);
//-[Garage4]
SetPlayerMapIcon(playerid, 69,1004.0070,-939.3102,42,55,0,MAPICON_GLOBAL);
//-[Garage5]
SetPlayerMapIcon(playerid, 70,1944.3260,-1772.9254,13.3906,55,0,MAPICON_GLOBAL);
//-[Garage6]
SetPlayerMapIcon(playerid, 71,-90.5515,-1169.4578,2.4079,55,0,MAPICON_GLOBAL);
//-[Garage7]
SetPlayerMapIcon(playerid, 72,-1609.7958,-2718.2048,48.5391,55,0,MAPICON_GLOBAL);
//-[Garage8]
SetPlayerMapIcon(playerid, 73,-2029.4968,156.4366,29,55,0,MAPICON_GLOBAL);
//-[Garage9]
SetPlayerMapIcon(playerid, 74,-2408.7590,976.0934,45.4175,55,0,MAPICON_GLOBAL);
//-[Garage10]
SetPlayerMapIcon(playerid, 76,-1676.6323,414.0262,7,55,0,MAPICON_GLOBAL);
//-[Garage11]
SetPlayerMapIcon(playerid, 78,-1328.0000,2677.0000,50.0625,55,0,MAPICON_GLOBAL);
//-[Garage12]
SetPlayerMapIcon(playerid, 79,70.0000,1218.0000,18.8113,55,0,MAPICON_GLOBAL);
//-[Garage13]
SetPlayerMapIcon(playerid, 80,2146.0000,2749.0000,10.8203,55,0,MAPICON_GLOBAL);
//-[Garage14]
SetPlayerMapIcon(playerid, 81,1595.0000,2201.0000,10.8203,55,0,MAPICON_GLOBAL);
//-[Garage15]
SetPlayerMapIcon(playerid, 82,-1464.0000,1863.0000,32.6398,55,0,MAPICON_GLOBAL);
//-[Garage16]
SetPlayerMapIcon(playerid, 83,652.0000,-560.0000,16.3359,55,0,MAPICON_GLOBAL);
//-[Garage17]
SetPlayerMapIcon(playerid, 84,1383.9152,461.1158,20.1088,55,0,MAPICON_GLOBAL);
}
if(Fuel[vehicleid] >= 10)
{
//--[Fuel]
//-[Garage1]
SetPlayerMapIcon(playerid, 66,2112.1772,918.1446,10.4451,55,0,MAPICON_LOCAL);
//-[Garage2]
SetPlayerMapIcon(playerid, 67,2640.4646,1102.7355,10.8203,55,0,MAPICON_LOCAL);
//-[Garage3]
SetPlayerMapIcon(playerid, 68,2201.8408,2475.9265,10.8203,55,0,MAPICON_LOCAL);
//-[Garage4]
SetPlayerMapIcon(playerid, 69,1004.0070,-939.3102,42,55,0,MAPICON_LOCAL);
//-[Garage5]
SetPlayerMapIcon(playerid, 70,1944.3260,-1772.9254,13.3906,55,0,MAPICON_LOCAL);
//-[Garage6]
SetPlayerMapIcon(playerid, 71,-90.5515,-1169.4578,2.4079,55,0,MAPICON_LOCAL);
//-[Garage7]
SetPlayerMapIcon(playerid, 72,-1609.7958,-2718.2048,48.5391,55,0,MAPICON_LOCAL);
//-[Garage8]
SetPlayerMapIcon(playerid, 73,-2029.4968,156.4366,29,55,0,MAPICON_LOCAL);
//-[Garage9]
SetPlayerMapIcon(playerid, 74,-2408.7590,976.0934,45.4175,55,0,MAPICON_LOCAL);
//-[Garage10]
SetPlayerMapIcon(playerid, 76,-1676.6323,414.0262,7,55,0,MAPICON_LOCAL);
//-[Garage11]
SetPlayerMapIcon(playerid, 78,-1328.0000,2677.0000,50.0625,55,0,MAPICON_LOCAL);
//-[Garage12]
SetPlayerMapIcon(playerid, 79,70.0000,1218.0000,18.8113,55,0,MAPICON_LOCAL);
//-[Garage13]
SetPlayerMapIcon(playerid, 80,2146.0000,2749.0000,10.8203,55,0,MAPICON_LOCAL);
//-[Garage14]
SetPlayerMapIcon(playerid, 81,1595.0000,2201.0000,10.8203,55,0,MAPICON_LOCAL);
//-[Garage15]
SetPlayerMapIcon(playerid, 82,-1464.0000,1863.0000,32.6398,55,0,MAPICON_LOCAL);
//-[Garage16]
SetPlayerMapIcon(playerid, 83,652.0000,-560.0000,16.3359,55,0,MAPICON_LOCAL);
//-[Garage17]
SetPlayerMapIcon(playerid, 84,1383.9152,461.1158,20.1088,55,0,MAPICON_LOCAL);
}
return 1;
}
public OnPlayerKeyState(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(PRESSED(KEY_SUBMISSION))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(VehicleInfo[vehicleid][vEngine] != 1)
{
if(Fuel[vehicleid] > 0)
{
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
VehicleInfo[vehicleid][vEngine] = 1;
GameTextForPlayer(playerid,"~w~Ignition: ~g~On", 200,3);
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Ignition State:"COLOR_GREEN" On");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn Off Ignition Press Key ~k~~TOGGLE_SUBMISSIONS~ ");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On/Off Lights Press Key ~k~~PED_FIREWEAPON~ ");
FuelTimer = SetTimer("FuelConsumptionLow",10000,true);
}
if(Fuel[vehicleid]<= 0)
{
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
VehicleInfo[vehicleid][vEngine] = 0;
GameTextForPlayer(playerid,"~w~You Are Out Of ~r~Fuel~w~!", 200,3);
KillTimer(FuelTimer);
}
}
else
{
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
VehicleInfo[vehicleid][vEngine] = 0;
GameTextForPlayer(playerid,"~w~Ignition: ~r~Off", 200,3);
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" Ignition State:"COLOR_RED" Off");
SendClientMessage(playerid,-1,COLOR_YELLOW"<<Vehicle Info>>"COLOR_WHITE" To Turn On/Off Lights Press Key ~k~~PED_FIREWEAPON~ ");
KillTimer(FuelTimer);
}
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == 2 && oldstate == 1)
{
new string2[24];
format(string2,sizeof string2,"Fuel:%i%",Fuel[vehicleid]);
TextDrawSetString(FuelTxt[playerid],string2);
}
if(newstate == 1 && oldstate == 2)
{
TextDrawHideForPlayer(playerid,FuelTxt[playerid]);
}
return 1;
}