15.08.2013, 20:38
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;
}