16.01.2011, 12:50
Hey!
I'm working on a small fuel script and I have some problems. There are no errors/warnings in the script, but it doesn't work. So I started to search for the problem(s).
These are the lines I modify the value of the vehicle's fuel:
The problem is when I enter a vehicle, the fuel goes up to 1000 and then quickly to 0.
I'm working on a small fuel script and I have some problems. There are no errors/warnings in the script, but it doesn't work. So I started to search for the problem(s).
These are the lines I modify the value of the vehicle's fuel:
pawn Код:
#define MAX_FUEL 1000.0
new Float:Fuel[MAX_VEHICLES],
FuelChecker[MAX_PLAYERS];
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
Fuel[vehicleid]=MAX_FUEL;//Only for testing..
FuelChecker[playerid]=SetTimerEx("FuelCheck",1000,1,"d",vehicleid);
return 1;
}
forward FuelCheck(vehicleid);
public FuelCheck(vehicleid){
Fuel[vehicleid]-=0.1;
return 1;
}