SA-MP Forums Archive
Dynamic IP ban - 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: Dynamic IP ban (/showthread.php?tid=153955)



Dynamic IP ban - sushihusi - 11.06.2010

Hello everybody!
I have got a cheater on my server with dynamic IP so i can ban him.
I have heard about dynamic ip ban.
Is it possible?


Re: Dynamic IP ban - Flashy - 11.06.2010

Well I think you mean that you ban the principal IP from this cheater.
Example:

Cheater have ID 55.444.333.223.

You can ban now the IP 55.444.*.*

It means you ban all IPs that have at the beginning 55.444.
In common the command is called /rangeban. Search on forum for it.


Re: Dynamic IP ban - Hiddos - 11.06.2010

Be careful with usage. 88.*.*.* will probably ban an entire country, while 88.54.151.* probably just bans a small location.


Re: Dynamic IP ban - sushihusi - 11.06.2010

Ok thanks!
Now i want to create if the player connects bans him
his ip is 109.61.***.***
i dont know how to use GetPlayerIP
can you help?

Code:
new plrIP[16];
  GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  if(!strcmp(plrIP, "109.61"))
  SendClientMessage(playerid, 0xFFFFFFFF, "hehehe -.-'");
  Ban(playerid);
will this work?


Re: Dynamic IP ban - Hiddos - 11.06.2010

Probably not.

I'd say enter as RCON admin and type /rcon banip 109.61.*.*


Re: Dynamic IP ban - sushihusi - 11.06.2010

ok i will try


Re: Dynamic IP ban - Jakku - 11.06.2010

I had exactly same problem. I fixed it via this simple code, under OnPlayerConnect of course.


pawn Code:
if (!udb_Exists(PlayerName(playerid))) { //If there is no account created with player's name, happens the following:

  new ip[16];
  GetPlayerIp(playerid, ip, sizeof(ip));
if (strcmp(ip, "85.76", false, 5) == 0) //If IP Starts with 85.76 (5 characters) = kick
{
  SendClientMessage(playerid, COLOR_ORED, "Error: Your IP- Address has been range banned by the management. Try again later or contact the management");
  Kick(playerid);
}
if (strcmp(ip, "85.77", false, 5) == 0) //If IP Starts with 85.77 (5 characters) = kick
{
  SendClientMessage(playerid, COLOR_ORED, "Error: Your IP- Address has been range banned by the management. Try again later or contact the management");
  Kick(playerid);
}
  }
This is my own one. Simple & working


Quote:
Originally Posted by Hiddos
Probably not.

I'd say enter as RCON admin and type /rcon banip 109.61.*.*
Don't do this. You might ban someone from the same range. Try to create something like my one above.


Re: Dynamic IP ban - Hiddos - 11.06.2010

Didn't strcmp compare two strings? Then I'm wondering how it works


Re: Dynamic IP ban - sushihusi - 11.06.2010

Yes but that /rcon banip worked
I have tried it to my ip
than i disconnected and when i connceted it sayd: You are banned from this server.
Thanks for help

PS:I will unban myself XD


Re: Dynamic IP ban - wolfcock - 10.07.2010

Quote:
Originally Posted by Flashy
View Post
Well I think you mean that you ban the principal IP from this cheater.
Example:

Cheater have ID 55.444.333.223.

You can ban now the IP 55.444.*.*

It means you ban all IPs that have at the beginning 55.444.
In common the command is called /rangeban. Search on forum for it.
or if you're really evil do "ipban 5*.***.***.***"