10.02.2011, 04:09
Ok i have a callback to remove fuel and when it gets to 0 its continues to -1 etc
Now how come if you in a vehicle and run the fuel empty (Not Getting Of IT Yet) it continues -1 -2 etc and keeps going not removing them and telling them its empty
Please help :S
EDIT: if you run it to 0 or -1 then get of then try get back on THEN it tells u its empty :S
pawn Код:
public FuelUpdate()
{
new string[128];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if(IsPlayerInAnyVehicle(i))
{
if(IsPlayerConnected(i))
{
new PVeh = GetPlayerVehicleID(i);
if(VFuel[PVeh] >= 1 || VFuel[PVeh] <= 100)//If inbettween 1 and 100...
{
VFuel[PVeh] -= 1;//Remove 1 fuel///
format(string, sizeof(string),"~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.
}
}
}
}
}
}
Please help :S
EDIT: if you run it to 0 or -1 then get of then try get back on THEN it tells u its empty :S