15.08.2013, 10:36
Hello everybody.Today I try to make my own unban but code get bugged anyone can helps me..
Problem is when I type /unban Wispo which name is in database it`s says me Unkown Command but when I type /unban Sanady it`s says Sanady is not in database...Anyone can helps me please!?
-Thanks Sanady
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);
mysql_store_result();
}
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;
}
-Thanks Sanady