10.02.2011, 04:34
pawn Код:
public FuelUpdate()
{
new string[128];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(GetPlayerState(i) == 2)
{
new PVeh = GetPlayerVehicleID(i);
if(VFuel[PVeh])//If inbettween 1 and 100
{
VFuel[PVeh] -= 1;//Remove 1 fuel///
format(string, 128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~Fuel: ~w~%d%",VFuel[PVeh]);//And show it
GameTextForPlayer(i,string,18000,3);//In GameText
}
else//Else if its 0
{
RemovePlayerFromVehicle(i);//Remove Player
SendClientMessage(i,RED,"This Vehicle Is Out Of Fuel!");//Tell Them Its Empty.
}
}
}
return 1;
}