[FilterScript] Anti-Bots Flood
#1

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.
Reply
#2

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

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!
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

Nice
Reply
#8

Nice + REP .
Reply
#9

Thanks
Reply
#10

Good job Keep it up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)