SA-MP Forums Archive
how to make counter for ip #+reps - 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: how to make counter for ip #+reps (/showthread.php?tid=482190)



how to make counter for ip #+reps - MahdiGames - 19.12.2013

Hello guys i got an idea to prevent the attackers but im stucked , the idea is like that on the attacker trying to connect under OnPlayerConnect ,i need to count his ip if his ip connected more than 2 time that mean attacker then ban playerid ,anyone can help , and could this helping?
So i need to get the player ip and save it then after 2 sec if reconnected ban the ip!


Re: how to make counter for ip #+reps - Hansrutger - 19.12.2013

Just an idea, if two players from same IP connects then do this:

https://sampwiki.blast.hk/wiki/GetPlayerIp
- Save the player's IP's into an array for instance "new ipArray[MAX_PLAYERS];" or something like that. Then try to see if with strcmp (string comperer) if the IP's are same.

Not sure if this would work, probably higher chance that it wouldn't than it would but tried at least. :P


Re: how to make counter for ip #+reps - MahdiGames - 19.12.2013

Mmmmmm.. what about getplayerip and save it if reconnected in 2 sec after that ban anyone could help??


Re: how to make counter for ip #+reps - Vince - 19.12.2013

This script comes with the server package by default. Look in the filterscripts folder.


Re: how to make counter for ip #+reps - MahdiGames - 20.12.2013

Btw attackers successing to reconnecting and can flooding