SA-MP Forums Archive
Jail Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Jail Command (/showthread.php?tid=560229)



Jail Command - Frankin - 27.01.2015

How to create Jail and unJail command ?


Re: Jail Command - CalvinC - 27.01.2015

Create a "jailed" variable, and then when using /jail [playerid], set the playerid's position, interior (To the jail) and set the variable to 1.
Then with an /unjail [playerid], check if the variable is set to 1, if so, set the playerid's position, interior (Outside of jail) and set the variable to 0.


Re: Jail Command - J0sh... - 27.01.2015

pawn Код:
new Jailed[MAX_PLAYERS];

CMD:jail(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new id;
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "/jail [id]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player id");
    SendClientMessage(id, "You've been jailed.");
    SetPlayerInterior(id, 3);
    SetPlayerPos(id, 197.6661, 173.8179, 1003.0234);
    Jailed[id]=1;
    return 1;
}
Sorry if it's wrong, made this in here. xD