Quote:
Originally Posted by bgedition
Try with this:
pawn Код:
new pname[24]; GetPlayerName(playerid, pname, 24); mysql_format(/*mysql connection*/, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname); mysql_tquery(/*mysql connection*/, query, "", "");
new rows, fields; cache_get_data(rows, fields, /*mysql connection*/); if(rows) { ShowPlayerDialog(playerid, 2344, DIALOG_STYLE_MSGBOX,"Name is banned from the server","Your name is banned from the server!\n post it in the Unban appeals Category.","OK",""); Kick(playerid); }
|
Can ya explain me what is that /*mysql connection*/ ?
pawn Код:
mysql_format(/*mysql connection*/, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname);
mysql_tquery(/*mysql connection*/, query, "", "");
cache_get_data(rows, fields, /*mysql connection*/);
Actually i'm using this in place of that, is there anything wrong with it?
pawn Код:
static mysql; //i'm using this
mysql_format(mysql, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname);
mysql_tquery(mysql, query, "", "");
cache_get_data(rows, fields, mysql);