Fuel System - No Fuel
#4

I've fixed it now but when I do /car engine - it says there is no fuel in the tank yet I've placed 100.00 fuel into the vehicle and placed that if it is smaller or equal to 1.0 fuel it will not start:

Код:
forward SetVehicleEngine(vehicleid, playerid);
public SetVehicleEngine(vehicleid, playerid)
{
	new string[128];
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
	{
		SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SERVER] Vehicle engine stopped successfully.");
		arr_Engine{vehicleid} = 0;
	}
    else if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
	{
		new
			Float: f_vHealth;

		GetVehicleHealth(vehicleid, f_vHealth);
		if(f_vHealth < 350.0) return SendClientMessage(playerid, COLOR_RED, "The car won't start - it's totalled!");
	    if(VehicleFuel[vehicleid] <= 1.0) return SendClientMessage(playerid, COLOR_RED, "The car won't start - there's no fuel in the tank!");
		SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SERVER] Vehicle engine started successfully (/car engine to turn the engine off).");
		arr_Engine{vehicleid} = 1;
	}
	return 1;
}
Reply


Messages In This Thread
Fuel System - No Fuel - by Scottylad - 30.10.2015, 15:44
Re: Fuel System - No Fuel - by ATGOggy - 30.10.2015, 16:47
Re: Fuel System - No Fuel - by feartonyb - 30.10.2015, 16:56
Re: Fuel System - No Fuel - by Scottylad - 31.10.2015, 00:51

Forum Jump:


Users browsing this thread: 1 Guest(s)