Fuel problem
#1

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:
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;
}
The problem is when I enter a vehicle, the fuel goes up to 1000 and then quickly to 0.
Reply
#2

#define MAX_FUEL 100
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)