Unban Command not working properly !
#3

Ban table : - http://prntscr.com/6u15aa

Ban cmd :
pawn Код:
CMD:ban(playerid, params[])
{
    LoginCheck(playerid);
    if(User[playerid][accountAdmin] >= 2)
    {
        new
            string[150],
            id,
            reason[128],
            when[128],
            ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
        ;

        gettime(ban_hr, ban_min, ban_sec);
        getdate(ban_years, ban_month, ban_days);

        if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "» "red"Player not connected.");
        if(User[playerid][accountAdmin] < User[id][accountAdmin])
        {
            SendClientMessage(playerid, -1, "» "red"You cannot use this command on high ranking admin.");
            format(string, sizeof(string), "[NOTIFY] "white"%s has attempted to banned you with the reason %s.", GetName(playerid), reason);
            SendClientMessage(id, COLOR_ORANGE, string);
           
            format(string, sizeof(string), "%s has attempted to banned %s but failed for %s", GetName(playerid), GetName(id), reason);
            Log("admin.txt", string);
            return 1;
        }

        format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);

        format(sInfo[last_bperson], 256, "%s", GetName(id));
        format(sInfo[last_bwho], 256, "%s", reason);
        savestatistics();

        AddBan(User[id][accountIP], 1);
        BanAcc(id, GetName(playerid), reason);
        ShowBan(id, GetName(playerid), reason, when);
       
        format(string, sizeof(string), "[BANNED] "white"%s has been banned by an admin due to "grey"%s"white".", GetName(id), reason);
        SendPlayerMessage(COLOR_RED, string);
        format(string, sizeof(string), "[BANNED] "white"%s has been banned by %s due to "grey"%s"white".", GetName(id), GetName(playerid), reason);
        SendAMessage(COLOR_RED, string);
        format(string, sizeof(string), "[BANNED] %s has been banned by %s due to %s.", GetName(id), GetName(playerid), reason);
        Log("ban.txt", string);
       
        KickDelay(id);
    }
    else
    {
        SendClientMessage(playerid, -1, "» "red"You are not authorized to use this command.");
    }
    return 1;
}
Reply


Messages In This Thread
Unban Command not working properly ! [Solved] - by Shadow5 - 13.04.2015, 05:51
Re: Unban Command not working properly ! - by Awdratai - 13.04.2015, 06:07
Re: Unban Command not working properly ! - by Shadow5 - 13.04.2015, 07:51
Re: Unban Command not working properly ! - by Shadow5 - 13.04.2015, 13:07
Re: Unban Command not working properly ! - by Jefff - 13.04.2015, 14:15
Re: Unban Command not working properly ! - by Shadow5 - 15.04.2015, 12:48
Re: Unban Command not working properly ! - by BleverCastard - 15.04.2015, 12:59
Re: Unban Command not working properly ! - by Shadow5 - 15.04.2015, 13:31
Re: Unban Command not working properly ! - by Shadow5 - 16.04.2015, 04:17
Re: Unban Command not working properly ! - by SickAttack - 16.04.2015, 06:26

Forum Jump:


Users browsing this thread: 2 Guest(s)