#1

Need An Cage Command and a jail command for admins ..zcmd, Ty If Any1 Give me that and also with unjail
Reply
#2

pawn Код:
dcmd_jail(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 3) {
            new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /jail [playerid] [minutes] [reason]");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[256];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
                if(PlayerInfo[player1][Jailed] == 0) {
                    GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
                    new jtime = strval(tmp2);
                    if(jtime == 0) jtime = 9999;

                    CMDMessageToAdmins(playerid,"JAIL");
                    PlayerInfo[player1][JailTime] = jtime*1000*60;
                    SetTimerEx("JailPlayer",5000,0,"d",player1);
                    SetTimerEx("Jail1",1000,0,"d",player1);
                    PlayerInfo[player1][Jailed] = 1;

                    if(jtime == 9999) {
                        if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"Administrator %s has jailed %s ",adminname, playername);
                        else format(string,sizeof(string),""#CRED"Administrator "#CGREEN"%s "#CWHITE"has jailed "#CGREEN"%s "#CYELLOW"[reason: %s]",adminname, playername, params[strlen(tmp)+1] );
                    } else {
                        if(!strlen(tmp3)) format(string,sizeof(string),""#CRED"Administrator "#C%s has jailed %s for %d minutes",adminname, playername, jtime);
                        else format(string,sizeof(string),"Administrator %s has jailed %s for %d minutes [reason: %s]",adminname, playername, jtime, params[strlen(tmp2)+strlen(tmp)+1] );
                    }
                    return SendClientMessageToAll(blue,string);
                } else return SendClientMessage(playerid, red, "Player is already in jail");
            } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin");
        } else return SendClientMessage(playerid,green,"ERROR:"#CWHITE" You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,green,"ERROR:"#CWHITE" You must be logged in to use this commands");
}
pawn Код:
dcmd_unjail(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 3) {
            new tmp[256], Index; tmp = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /jail [playerid]");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[256];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
                if(PlayerInfo[player1][Jailed] == 1) {
                    GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
                    format(string,sizeof(string),"Administrator %s has unjailed you",adminname);    SendClientMessage(player1,blue,string);
                    format(string,sizeof(string),"Administrator %s has unjailed %s",adminname, playername);
                    JailRelease(player1);
                    return SendClientMessageToAll(blue,string);
                } else return SendClientMessage(playerid, red, "Player is not in jail");
            } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin");
        } else return SendClientMessage(playerid,green,"ERROR: "#CWHITE"You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,green,"ERROR:"#CWHITE" You must be logged in to use this commands");
}
pawn Код:
forward JailPlayer(player1);
public JailPlayer(player1)
{
    TogglePlayerControllable(player1,true);
    SetPlayerPos(player1,197.6661,173.8179,1003.0234);
    SetPlayerInterior(player1,3);
    SetCameraBehindPlayer(player1);
    JailTimer[player1] = SetTimerEx("JailRelease",PlayerInfo[player1][JailTime],0,"d",player1);
    PlayerInfo[player1][Jailed] = 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)