SA-MP Forums Archive
[FilterScript] Anti-Bots Flood - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti-Bots Flood (/showthread.php?tid=537445)



Anti-Bots Flood - XStormiest - 15.09.2014

Ok, so i created this Anti-Bots Flood protection, its an really easy system, but cool.
I've created it within 5 minutes.
pawn Код:
// Anti-Flood
#include <a_samp>
#define MAX_CONNECT 1
new UserMaxConnect[MAX_PLAYERS];
new ip[30];
forward CheckIfFlood(playerid);
public CheckIfFlood(playerid)
{
  new ips[MAX_PLAYERS];
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
     GetPlayerIp(playerid, ips, sizeof(ips));
         if(!strcmp(ip, ips, false))
         {
                UserMaxConnect[playerid]++;
         }
  }
  if(UserMaxConnect[playerid] > MAX_CONNECT)
  {
         Ban(playerid);
  }
  return 1;
}
 
public OnPlayerConnect(playerid)
{
  GetPlayerIp(playerid, ip, sizeof(ip));
  UserMaxConnect[playerid] = 0;
  SetTimerEx("CheckIfFlood", 1000, true, "i", playerid);
  return 1;
}
//Anti bots - Flood Protection
// Nu se pot connecta mai mult de numarul de la MAX_CONNECT de pe acelasi IP
An nice, protection against those wants to flood your server.


Re: Anti-Bots Flood - IDarkness - 15.09.2014

Its cool but will stop the area gaming like friends, brothers maybe net cafйs too , good work anyway rep 4 u


Re: Anti-Bots Flood - SickAttack - 15.09.2014

This is very bad (in my opinion), it limits the amount of player's that can join whitin the same internet connection, this means that you can't play on the same server with your borthers, friends or even other people using the same internet connection as you.

@IDarknedd - Could you use a smaller picture for your signature? It's large!


Re: Anti-Bots Flood - Abagail - 16.09.2014

Indeed. And you can just limit the amount of server connections per x time or you could do that script-wise as well(0.3z brings the ability to do it without additional scripting). This is not practical at all.


Re: Anti-Bots Flood - XStormiest - 18.09.2014

Thanks anyway, i did it with the MAX_CONNECTION, thing, so you can set the amount of max connection per user, for example if you want to use this in order to play with your 200 brothers, just set that to 200 and you can player with them, I know is not the best script, but at least is good scripted + i did in 5 minute for a standard server.


Re: Anti-Bots Flood - rymax99 - 18.09.2014

Makes no sense to ban after 2 connections - as said above, it's not uncommon for internet cafes to be used, or for multiple people on the same IP to be playing.


Re: Anti-Bots Flood - KayJ - 18.09.2014

Nice


Re: Anti-Bots Flood - Manuel_Franco - 21.09.2014

Nice + REP .


Re: Anti-Bots Flood - XStormiest - 21.09.2014

Thanks


Re: Anti-Bots Flood - momo123 - 21.09.2014

Good job Keep it up