[HELP] Command
#1

I wish when an admin type /freezeall to freeze all payers on server, but not admins. What I did not work. A little help?

pawn Код:
if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fall", true) == 0)
    {
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[playerid][pAdmin] >= 5)
            {
                if (IsPlayerConnected(i))
                {
                    TogglePlayerControllable(i,0);
                    new ab[256];
                    format(ab,sizeof(ab),"[ANTI-ABUSE] %s ussed /freezeall command !",GetName(playerid));
                    SendToAdmins(COLOR_LIGHTRED,ab);
                }
                if(PlayerInfo[playerid][pAdmin] > 0)
                {
                    TogglePlayerControllable(i,1);
                    SendClientMessage(playerid, COLOR_GREY, "INFO: Don't got freezed, because you are an admin !");
                }
            }
            else
            {
                    SendClientMessage(playerid, COLOR_GREY, "Acces denied !");
            }
        }
        return 1;
    }
Reply
#2

Move if(PlayerInfo[playerid][pAdmin] > 0) under if(IsPlayerConnected(i)) and replace playerid by i.
Reply
#3

pawn Код:
if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fall", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "Access denied!");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(PlayerInfo[i][pAdmin]) continue;
            TogglePlayerControllable(i,0);
        }
        new ab[70];
        format(ab, sizeof(ab), "[ANTI-ABUSE] %s used /freezeall command !",GetName(playerid));
        SendToAdmins(COLOR_LIGHTRED, ab);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)