26.03.2013, 18:43
Thanks man
it fixed the problem when you could drive for a second if you did /e after the fuel hit 0.
Do you know how I would fix the problem when the fuel must go down if the engine is on(when someone is a driver, passenger or not in the vehicle at all?)
Also, the TextDraw that shows the fuel bar works for some players and not for others, it seems like it's random on when you enter a vehicle
Thanks
My /e cmd looks like this now, is that correct?

Do you know how I would fix the problem when the fuel must go down if the engine is on(when someone is a driver, passenger or not in the vehicle at all?)
Also, the TextDraw that shows the fuel bar works for some players and not for others, it seems like it's random on when you enter a vehicle

Thanks

My /e cmd looks like this now, is that correct?
pawn Код:
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)//Checks if the player is the driver
{
new string[128];
new vehicle = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 1)//If the engine is on
{
if(0 == fuel[vehicle]) // if theres no
{
//Send some message that there is no fuel, or something
SCM(playerid,-1,"There is no fuel!");
return 1;
}
format(string, sizeof(string), "%s turns the key in the ignition, turning the engine off.", GetName(playerid), params);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetVehicleParamsEx(vehicle,0,0,alarm,doors,bonnet,boot,objective);
ISENGINEON =false;
}
else//Else is the engine is off
{
SetVehicleParamsEx(vehicle,1,0,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "%s places the key in the vehicles ignition and turns it, starting the engine.", GetName(playerid), params);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ISENGINEON = true;
}
}
return 1;
}