Fuel System - Help
#2

Bro. With this line:
for(new i=0;i<MAX_VEHICLES;i++)
You're telling the script to read from vehicles, not players.
Where here:
SetVehicleParamsEx(i, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
You're also telling the script to read from vehicles, not players.

The reason being is because i, in this code, stands for max_vehicles, not for max_players.
So you need to probably do this:

Код:
#include <a_samp>


forward FuelConsumption();
public FuelConsumption()
{
    for(new i=0;i<MAX_VEHICLES;i++)
    {
        VehicleGas -= 1;
        if(VehicleGas[i] == 0)
        {
			for(new playerid; playerid < MAX_PLAYERS; playerid++)
	    	{
				SetVehicleParamsEx(playerid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
			}
		}
	}
	return 1; // Not really sure if yours is a timer or what, don't return this value if you don't need to in your code.
}
Reply


Messages In This Thread
Fuel System - Help - by luis_lpv_22 - 28.11.2011, 10:30
Re: Fuel System - Help - by Jake__ - 28.11.2011, 12:42
Respuesta: Fuel System - Help - by luis_lpv_22 - 28.11.2011, 13:20
Re: Fuel System - Help - by Unte99 - 28.11.2011, 13:32
Re: Fuel System - Help - by CONTROLA - 28.11.2011, 13:42
Re: Fuel System - Help - by Unte99 - 28.11.2011, 13:56

Forum Jump:


Users browsing this thread: 1 Guest(s)