Thread: unban cmd error
View Single Post
Old 21/03/2014, 04:02 PM   #7
Carac
Little Clucker
 
Join Date: Mar 2011
Posts: 46
Reputation: 1
Default Re: unban cmd error

I'm using this one
pawn Code:
CMD:unban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pBanAppealer] >= 1)
    {
        if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5)
        {
            SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
            return 1;
        }

        new string[128];
        if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playername]");

        if(doesAccountExist(params))
        {
            OnPlayerOfflineLogin(params);
            if(PlayerInfo[MAX_PLAYERS][pPermaBanned] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Permanently banned accounts can only be unbanned via FTP.");
            }
            else
            {
                if(PlayerInfo[MAX_PLAYERS][pBanned] >= 1)
                {
                    PlayerInfo[MAX_PLAYERS][pBanned] = 0;

                    if(PlayerInfo[MAX_PLAYERS][pWarns] == 3)
                        PlayerInfo[MAX_PLAYERS][pWarns] = 0;

                    RemoveBan(PlayerInfo[MAX_PLAYERS][pIP]);
                    OnPlayerOfflineSave(params);
                    format(string, 128, "AdmCmd: %s (IP:%s) was unbanned by %s.", params, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid));
                    ABroadCast(COLOR_LIGHTRED,string,2);
                    format(string, sizeof(string), "AdmCmd: %s (IP:%s) was unbanned by %s.", params, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid));
                    Log("logs/ban.log", string);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Not a banned account!");
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "That account doesn't exist.");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
    }
    return 1;
}
__________________
Carac is offline   Reply With Quote