Jail Command
#1

How to create Jail and unJail command ?
Reply
#2

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)