Ok so i was watching a tv series where they had a bait car where they can kill the engine and lock the doors with a press of a botton so i remembered that the server controls those features now so is it possible to have a command for police such as /killengine VIN or something along those lines where the police officer is able to turn the engine off and trap the suspect in the car.
how would i start it off could you show a bit of code so i can start on it
pawn Код:
CMD:killengine(playerid, params[])
{
new Player;
if (sscanf(params, "u", Player))
{
SendClientMessage(playerid, 0xFF0000AA, "[USAGE]/killengine [PlayerName/PlayerID]");
}
else if(Player == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, 0xFF0000AA, "Invalid PlayerName/PlayerID");
}
else if(Player == playerid)
{
SendClientMessage(playerid, 0xFF0000AA, "Invalid PlayerName/PlayerID");
}
else if(!IsPlayerInAnyVehicle(Player))
{
SendClientMessage(playerid, 0xFF0000AA, "Player Must Be In A Car");
}
else
{
new enginekill = GetPlayerVehicleID(Player);
GetVehicleParamsEx(enginekill, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 1)
{
SetVehicleParamsEx(enginekill, 0, lights, alarm, doors, bonnet, boot, objective);
}
else
{
SendClientMessage(playerid, YOURCOLOR, "Error: Engine already turned off");
}
}
return 1;
}