[Include] FloodControl.inc ─ Easily block flood bots
#1

Introduction

I saw JernejL's topic about blocking flood bots and read this comment:
Quote:
Originally Posted by JernejL
Посмотреть сообщение
Anyways, i post snippets.. i'm hoping someone of you will turn this into a filterscript that reads a flood limit number off a cfg file and enables people to easily set up flood control.
So I decided to quickly create a simple include which makes it very easy to manage everything.

Functions

We have only one callback:
pawn Код:
forward OnPlayerFloodControl(playerid, iCount, iTimeSpan);
And two defines:
pawn Код:
#if !defined MAX_JOIN_LOGS
    #define MAX_JOIN_LOGS (50)
#endif
pawn Код:
#if !defined MAX_THRESHOLD
    #define MAX_THRESHOLD (8000) // The amount of time in which all joins are valid and counted
#endif
Your custom values will be applied once you set these values before including it.

Example

The following example will IP-Ban the player/bot that joined more than 2 times in a time span of less then 8 seconds:
pawn Код:
#include <a_samp>
#include <FloodControl>

public OnPlayerFloodControl(playerid, iCount, iTimeSpan) {
    if(iCount > 2 && iTimeSpan < 8000) {
        Ban(playerid);
    }
}

public OnPlayerConnect(playerid) {
    return 1;
}
You can customize it like however you want it.

Download

FloodControl.inc

Changelog
  • 24/02/2012:
    • Initial release
  • 28/06/2012:
    • Fixed an important bug where the timespan gets messed up if you first join, wait a bit, and then spam.
    • Fixed the hooking method.
    • Added:
      pawn Код:
      #if !defined MAX_THRESHOLD
          #define MAX_THRESHOLD (8000) // The amount of time in which all joins are valid and counted
      #endif
      This was important to fix the first bug.
Reply


Messages In This Thread
FloodControl.inc ─ Easily block flood bots - by RyDeR` - 24.02.2012, 00:48
Respuesta: FloodControl.inc ─ Easily block flood bots - by [Nikk] - 24.02.2012, 01:52
Re: FloodControl.inc ─ Easily block flood bots - by Niko_boy - 24.02.2012, 06:51
Re: FloodControl.inc ─ Easily block flood bots - by Kaperstone - 24.02.2012, 09:42
Re: FloodControl.inc ─ Easily block flood bots - by Michael@Belgium - 24.02.2012, 11:16
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 24.02.2012, 16:33
Re: FloodControl.inc ─ Easily block flood bots - by Modrlicc - 25.02.2012, 12:08
Re: FloodControl.inc ─ Easily block flood bots - by lordturhan - 26.02.2012, 07:58
Re: FloodControl.inc ─ Easily block flood bots - by Lorenc_ - 26.02.2012, 08:09
Re: FloodControl.inc ─ Easily block flood bots - by lordturhan - 26.02.2012, 08:18
Re: FloodControl.inc ─ Easily block flood bots - by wups - 26.02.2012, 09:09
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 26.02.2012, 10:02
Re: FloodControl.inc ─ Easily block flood bots - by wups - 26.02.2012, 17:27
Re: FloodControl.inc ─ Easily block flood bots - by Translator - 27.02.2012, 06:26
Re: FloodControl.inc ─ Easily block flood bots - by wups - 27.02.2012, 11:41
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 27.02.2012, 17:11
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 28.06.2012, 12:54
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 28.06.2012, 13:17
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 28.06.2012, 13:30
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 28.06.2012, 13:39
Re: FloodControl.inc ─ Easily block flood bots - by Dubya - 04.07.2012, 21:42
Re: FloodControl.inc ─ Easily block flood bots - by RoacH` - 04.07.2012, 22:22
Re: FloodControl.inc ─ Easily block flood bots - by ipsBruno - 04.07.2012, 22:42
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 05.07.2012, 08:31
Re: FloodControl.inc ─ Easily block flood bots - by ipsBruno - 05.07.2012, 21:41
Re: FloodControl.inc ─ Easily block flood bots - by dreamboxxl - 11.07.2012, 04:08
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 11.07.2012, 09:57
Re: FloodControl.inc ─ Easily block flood bots - by dreamboxxl - 11.07.2012, 13:09
Re: FloodControl.inc ─ Easily block flood bots - by PawnFox - 11.07.2012, 14:06
Re: FloodControl.inc ─ Easily block flood bots - by fuem1907 - 17.07.2012, 04:36
Re: FloodControl.inc ─ Easily block flood bots - by shayan122 - 17.07.2012, 04:48
Re: FloodControl.inc ─ Easily block flood bots - by RyDeR` - 17.07.2012, 08:58
Re: FloodControl.inc ─ Easily block flood bots - by Xenoyia - 17.07.2012, 18:19
Re: FloodControl.inc ─ Easily block flood bots - by niels44 - 21.11.2012, 07:11
Re: FloodControl.inc ─ Easily block flood bots - by Killa[DGZ] - 18.12.2012, 14:35
Re: FloodControl.inc ─ Easily block flood bots - by Lapon - 22.12.2012, 04:03
Re: FloodControl.inc ─ Easily block flood bots - by Omirrow - 30.05.2014, 11:23
Re: FloodControl.inc ─ Easily block flood bots - by iRaiDeN - 31.05.2014, 04:31
Re: FloodControl.inc ─ Easily block flood bots - by Agent008 - 31.05.2014, 11:08
Re: FloodControl.inc ─ Easily block flood bots - by Chrillzen - 04.10.2014, 12:32
Re: FloodControl.inc ─ Easily block flood bots - by berat00 - 02.06.2015, 08:39
Re: FloodControl.inc ─ Easily block flood bots - by NexySamp - 29.07.2015, 12:26
AW: FloodControl.inc ─ Easily block flood bots - by Kaliber - 29.07.2015, 21:06
Re: FloodControl.inc ─ Easily block flood bots - by waysemir - 30.01.2019, 15:47

Forum Jump:


Users browsing this thread: 1 Guest(s)