12.07.2011, 13:55
I have a command for engine, /engine. But when I type /engine to turn on the engine for the first time, I have to type it twice, because the first time nothing happens.
pawn Код:
CMD:engine(playerid)
{
new vehid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine)return SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,lights,alarm,doors,bonnet,boot,objective);
return 1;
}