Check IP when connect? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check IP when connect? (
/showthread.php?tid=201516)
Check IP when connect? -
Jantjuh - 21.12.2010
Hey guys,
So far i got this script:
Код:
public OnFilterscriptInit()
{
print("\n------------------------------");
print(" Lolzzzz ");
print("------------------------------\n");
}
public OnPlayerConnect(playerid)
{
new a[16];
GetPlayerIp(playerid, a, sizeof(a));
}
How can I make it so it will kick the player when his IP is found on a .txt document on a website? What is/are the function(s) for this?
Thankx!
Re: Check IP when connect? -
bestr32 - 05.03.2011
For tut you must #define IP_FINDER "location"
like:
#define IP_FINDER "myserver\%s.txt" // NOTE: Change myserver to something
So this will do it, and than you need to block some ips like: 66.92.110.20.
So if u find it on a website, You will find it on the scriptfiles\myserver\%s.txt too.
for how to block it.. Ask others.
Try this if it works if u got errors on compiling, reply.
And do this also!
Add
Код:
format(file, sizeof(file), SERVER_USER_FILE, IP);
At OnPlayerConnect under GetPlayerIP.
Also add
at:
Код:
public OnPlayerConnect(playerid)
{
new file[256];
new a[16];
format(file, sizeof(file), SERVER_USER_FILE, IP);
GetPlayerIp(playerid, a, sizeof(a));
return 1;
}
ARGH Just copy
Код:
public OnPlayerConnect(playerid)
{
new file[256];
new a[16];
format(file, sizeof(file), SERVER_USER_FILE, IP);
GetPlayerIp(playerid, a, sizeof(a));
return 1;
}