18.02.2012, 23:23
Alright I made this command:
It should either turn on or off an engine when your in the vehicle, but the issue is, when I spawn a car and go in it and do /engine it always say "turning off the vehicle" part. But the vehicles spawn as off already, so how could I fix this issue? Thank you very much in advance!
pawn Код:
CMD:engine(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid);
new string[128];
GetVehicleParamsEx(car, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0)
{
SetTimerEx("Engine", 5000, false, "d", playerid);
format(string, sizeof(string), "* %s tries to turn on the vehicle engine.. *", pName(playerid));
SendLocalMessage(playerid, string, 10.0, COLOR_PINK, COLOR_PINK);
}
else
{
SetVehicleParamsEx(car,0,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns the key on the ignition, turning off the vehicle.. *", pName(playerid));
SendLocalMessage(playerid, string, 10.0, COLOR_PINK, COLOR_PINK);
}
}
return 1;
}
It should either turn on or off an engine when your in the vehicle, but the issue is, when I spawn a car and go in it and do /engine it always say "turning off the vehicle" part. But the vehicles spawn as off already, so how could I fix this issue? Thank you very much in advance!