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;
}
CMD:engine(playerid,o[])
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
new pname[MAX_PLAYER_NAME];GetPlayerName(playerid,pname,sizeof(pname));
if(GetPVarInt(playerid, "Lights") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "Lights", 1);
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);
}else if(GetPVarInt(playerid, "Lights") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "Lights", 0);
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;
}
Oh thank you
![]() +1 rep! But if some other player gets in that vehicle which it's engine is off will he be able to drive or he has to turn it on? |