Guest User

d0

a guest
Feb 7th, 2012
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.61 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_CONNECT_IN_ROW 3
  4. #define MAX_REJOIN_TIME 4000
  5. new ipCheck[25], IPfound, IPtime;
  6.  
  7. public OnPlayerConnect(playerid)
  8. {
  9.     new pIP[25];
  10.     GetPlayerIp(playerid, pIP, 25);
  11.     if(strcmp(ipCheck, pIP, false) == 0 && ( GetTickCount() - IPtime ) < MAX_REJOIN_TIME )
  12.     {
  13.         IPfound++;
  14.         if(IPfound > MAX_CONNECT_IN_ROW)
  15.         {
  16.             new str[100];
  17.             format(str, 100, "banip %s", pIP);
  18.             SendRconCommand(str);
  19.             Kick(playerid);
  20.             IPfound=0;
  21.         }
  22.     }
  23.     else
  24.     {
  25.         IPfound=0;
  26.     }
  27.     format(ipCheck, 25, "%s", pIP);
  28.    
  29.     IPtime=GetTickCount();
  30.     return 1;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment