25.03.2016, 19:18
It would be something like:
I'm not very sure about function cache_num_rows, but try it., but try it.
sorry for my bad english.
pawn Код:
new query[126];
format(query,sizeof(query),"SELECT * FROM table_bans WHERE Name='%s'",playername);
mysql_query(mysql,query);
if(cache_num_rows() > 0)
{
new banstring[256];
new bName[30],bIP[30],bAdmin[30],bReason[30];
cache_get_field_content(0,"Name",bName);
cache_get_field_content(0,"IP",bIP);
cache_get_field_content(0,"Admin",bAdmin);
cache_get_field_content(0,"Reason",bReason);
format(banstring,sizeof(banstring),"Name: %s\nIP: %s\nAdmin: %s\nReason: %s",bName,bIP,bAdmin,bReason);
ShowPlayerDialog(playerid,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"Account Banned",banstring,"Aceptar","");
Kick(playerid);
}
sorry for my bad english.