Unban help
#4

Here is new update of code but same problem anyone helps me?

pawn Код:
CMD:unban(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 3 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");
    new id,Query[250];
    if(sscanf(params,"u",id)) return SendUsage(playerid,"/unban [Player ID / Player Name]","0");

    format(Query,sizeof(Query),"SELECT * FROM `sampbans` WHERE `banusername` = '%s'",pName[id]);
    mysql_query(Query);
    mysql_store_result();
    if(mysql_num_rows() == 1)
    {
        SendClientMessageEx(playerid,0xFFFFFFF,""embed_orange"[Unban] "embed_white"%s has been unbanned!",pName[id]);
        format(Query,sizeof(Query),"DELETE * FROM `sampbans` WHERE `banusername` = '%s'",pName[id]);
        mysql_query(Query);
    }
    else if(!mysql_num_rows())
    {
        SendClientMessageEx(playerid,0xFFFFFFF,""embed_orange"[Unban] "embed_white"%s is not in database!",pName[id]);
    }
    mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
Unban help - by Sanady - 15.08.2013, 10:36
Re: Unban help - by Sanady - 15.08.2013, 10:53
Re: Unban help - by Sanady - 15.08.2013, 11:16
Re: Unban help - by Sanady - 15.08.2013, 20:38
Re: Unban help - by Virtual1ty - 16.08.2013, 02:09

Forum Jump:


Users browsing this thread: 2 Guest(s)