SA-MP Forums Archive
Banning the IP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Banning the IP (/showthread.php?tid=392040)



Banning the IP - Elysian` - 12.11.2012

I have IP's stored in the MySQL colum (IP) and I want to know how to ban the IP and how to unban the IP ingame..

Thanks.

pawn Код:
CMD:oban(playerid, params[])
{
    new name, query[64], string[64];
    if(sscanf(params,"s",name)) return SendClientMessage(playerid, COLOR_RED, "|- Error: /o(ffline)ban [name] -|");
    format(query, sizeof(query), "UPDATE players SET ban = '1' WHERE Username = '%s'", name);
    mysql_query(query, THREAD_NO_RESULT, name, iConnectionHandle);
    format(string, sizeof(string), "You have banned %s", name);
    SendClientMessage(playerid, COLOR_RED, string);
    return 1;
}