23.01.2016, 17:35
so can anyone let me know whats the problem with this
Basically it doesnt work, if you ban someones IP it will still let them play normaly. The check doesnt work
Basically it doesnt work, if you ban someones IP it will still let them play normaly. The check doesnt work
PHP код:
new myIP[16];
GetPlayerIp(playerid, myIP, sizeof(myIP));
if(IPBanned(myIP)) {
Kick(playerid);
return true;
}
IPBanned(const str[])
{
new query[85],Cache:result,rows;
mysql_format(mysql, query, sizeof(query), "SELECT `IP` FROM `ipbanned` WHERE `IP` = '%e' LIMIT 1",str);
result = mysql_query(mysql, query);
if((rows = cache_num_rows()))
{
rows = cache_get_row_int(0, 0);
cache_delete(result);
return rows;
}
cache_delete(result);
return rows;
}