Unban Command not working properly !
#1

pawn Код:
CMD:unban(playerid, params[])
{
    LoginCheck(playerid);
    if(User[playerid][accountAdmin] >= 2)
    {
        new
            string[150],
            Account[24],
            DBResult:Result,
            Query[129],
            fIP[30]
        ;
        if(sscanf(params, "s[24]", Account)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /unban [account name]");
        format(Query, 129, "SELECT  FROM `bans` WHERE `username` = '%s'", Account);
        Result = db_query(Database, Query);

        if(db_num_rows(Result))
        {
            db_get_field_assoc(Result, "ip", fIP, 30);
            if(CheckBan(fIP))
            {
                RemoveBan(fIP);
            }
            format(Query, 129, "DELETE FROM `bans` WHERE `username` = '%s'", Account);
            Result = db_query(Database, Query);
            db_free_result(Result);

            format(string, sizeof string, "[UNBANNED] "white"%s has been unbanned by an admin.", Account);
            SendPlayerMessage(COLOR_ORANGE, string);
            format(string, sizeof string, "[UNBANNED] "white"%s has been unbanned by %s.", Account, GetName(playerid));
            SendAMessage(COLOR_ORANGE, string);
            format(string, sizeof string, "[UNBANNED] %s has been unbanned by %s.", Account, GetName(playerid));
            Log("ban.txt", string);
        }
        else
        {
            db_free_result(Result);
            SendClientMessage(playerid, -1, "» "red"Player is not in the banned database.");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "» "red"You are not authorized to use this command.");
    }
    return 1;
}
It's not working ''It says Player not banned in the DB'',Anti-Ban evade is not letting him log in which means he is Banned but the CMD is not working or something !

Screenshots of SQlite DB :

-Links removed due to IPs in the Screenshots !
__________________
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: 1 Guest(s)