23.02.2013, 19:11
I made a small fuel system, but when player exists the vehicle the fuel stays the same when he went out,
how can I make like that the fuel will keep going down.
how can I make like that the fuel will keep going down.
pawn Код:
public CheckGas()
{
foreach(Player, i)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
if(IsADMVCar(vehicle) || !engineOn[vehicle]) { return 1; }
if(engineOn[vehicle])
{
Gas[vehicle]--;
if(Gas[vehicle] == 0)
{
VehicleEngine(vehicle, false);
}
}
}
}
return 1;
}