#include #include #include #define VERSION "1.0.3" #define COLOR_RED 0xAA3333AA public OnFilterScriptInit(){ print("\n-------------------------------------------------\n"); printf(" S:Anti-Flood %s by Sacky\n",VERSION); print("-------------------------------------------------"); } new connect[MAX_PLAYERS]; new hack; public OnPlayerConnect(playerid){ if(!PropertyExists("Timer")){ PropertySet("Timer","On"); SetTimer("SecTimer",1000,true); SetTimer("ClearHack",60000,true); } connect[playerid] = 0; if(hack > 5){ hack = 0; Ban(playerid); new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); new tmpstr[64]; format(tmpstr,sizeof(tmpstr),"[S:Anti-Flood] Banned: %s for flood hack",playername); print(tmpstr); SendClientMessageToAll(COLOR_RED,tmpstr); } return 1; } public OnPlayerDisconnect(playerid){ if(connect[playerid] < 3){ hack++; } return 1; } public SecTimer(){ for(new i=0;i