Guest User

Untitled

a guest
Feb 4th, 2012
1,215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.52 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnPlayerConnect(playerid)
  4. {
  5.     if((GetTickCount()-GetPVarInt(playerid, "ConnectionTime")) < 200 && CountIP(PlayerIP(playerid)) >= 5)
  6.     {
  7.         Ban(playerid);
  8.     }
  9.     SetPVarInt(playerid, "ConnectionTime", GetTickCount());
  10.     return 1;
  11. }
  12.  
  13. CountIP(ip[])
  14. {
  15.     new countip;
  16.  
  17.     for(new i = 0; i < GetMaxPlayers(); i++)
  18.         if(IsPlayerConnected(i) && !strcmp(PlayerIP(i),ip))
  19.             countip++;
  20.     return countip;
  21. }
  22.  
  23. PlayerIP(playerid)
  24. {
  25.     new ip[16];
  26.     GetPlayerIp(playerid,ip,sizeof(ip));
  27.     return ip;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment