Is it possible?
#1

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.
Reply
#2

Yeah it probably is.
Reply
#3

how would i start it off could you show a bit of code so i can start on it
Reply
#4

Sure something like:

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;
}
But I use zcmd and sscanf, which I recommand so try it

If you wanna start using zcmd and sscanf heres a tutorial:
http://forum.sa-mp.com/showthread.ph...76#post1142276
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)