17.01.2010, 18:16
Do it like this:
(Assuming mysql_num_rows() is the function to get the amount of rows retrieved)
pawn Код:
public OnPlayerConnect(playerid)
{
new query[265];
new ip[20];
GetPlayerIp(playerid, ip, 16);
format(query, sizeof(query), "SELECT ip FROM `bans` WHERE ip = '%s'", ip);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
SendClientMessage(playerid, COLOR_RED, "You Are Banned From This Server");
SendClientMessage(playerid, COLOR_RED, "To Appeal This Ban Please Goto Out Forums");
SendClientMessage(playerid, COLOR_RED, "At http://www.rock-gaming.com[url=http://][/url]");
Kick(playerid);
}
else
{