28.10.2011, 16:17
Hello,
I'm trying to script an /engine command that checks if your engine is on or off then if the engine is on it turns it off or if its off it turns it on
This is what I got so far but it doesn't work, can't figure out what's the problem, I hope someone knows what the problem is
Thanks.
I'm trying to script an /engine command that checks if your engine is on or off then if the engine is on it turns it off or if its off it turns it on
This is what I got so far but it doesn't work, can't figure out what's the problem, I hope someone knows what the problem is
pawn Код:
CMD:engine(playerid,o[])
{
static
vid,
vid1,
str[80],
str1[80],
pname[MAX_PLAYER_NAME],
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective
;
vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine==0)
{
SetVehicleParamsEx(vid,1,0,0,0,0,0,0);
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str),"%s has turned his vehicle's engine on.",pname);
ProxDetector(25.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
if(engine==1)
{
vid1 = GetPlayerVehicleID(playerid);
SetVehicleParamsEx(vid1,0,0,0,0,0,0,0);
GetPlayerName(playerid,pname,sizeof(pname));
format(str1,sizeof(str1),"%s has turned his vehicle's engine off.",pname);
ProxDetector(25.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
return 1;
}