ATTENTION: This cmds aren't tested !
I think need to be something like this:
Put this on top (is the variable for see if the engine is already turned on/off) :
new Engine[MAX_VEHICLES];
/c engineon
else if(strcmp(cmd, "engineon", true) == 0) {
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_GREEN,"You need to be in vehicle to can use this cmd !");
else if(Engine[vehicleid] == 1) SendClientMessage(playerid,COLOR_GREEN,"Your vehicle engine is already on !");
else {
RemovePlayerFromVehicle(playerid);
PutPlayerInVehicle(playerid,vehicleid);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Engine Was Turned ON !");
Engine[vehicleid] = 1;
}
return 1;
}
/c engineoff
else if(strcmp(cmd, "engineoff", true) == 0) {
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_GREEN,"You need to be in vehicle to can use this cmd !");
else if(Engine[vehicleid] == 0) SendClientMessage(playerid,COLOR_GREEN,"Your vehicle engine is already off !");
else {
KillVehicleEngine(vehicleid);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Engine Was Turned OFF !");
Engine[vehicleid] = 0;
}
return 1;
}