Float problem
#2

pawn Code:
OnGameModeInit()
{
    // ...
    for (new i = 0; i < MAX_VEHICLES; i++) Gas[i] = 1.0 * (random(65) + 15);
    // ...
}

OnVehicleSpawn(vehicleid)
{
    Gas[vehicleid] = 1.0 * (random(65) + 15);
    // ...
}
Edit: You also need a timer to respawn all unoccupied vehicles with an interval (ex. 60000ms = 10m) to prevent out-of-fuel vehicles from being abandoned forever; I'll leave that to yourself.

Hope I helped ^^
Reply


Messages In This Thread
Float problem - by IceBilizard - 13.10.2014, 05:44
Re: Float problem - by AnnaSB - 13.10.2014, 07:57
Re: Float problem - by IceBilizard - 14.10.2014, 04:14
Re: Float problem - by AngeloBrand98 - 05.09.2017, 20:25
Re: Float problem - by AngeloBrand98 - 05.09.2017, 20:27

Forum Jump:


Users browsing this thread: 1 Guest(s)