Guest User

Untitled

a guest
Nov 3rd, 2010
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.51 KB | None | 0 0
  1. #define MAX_PING                        500
  2.  
  3. forward CheckPing();
  4.  
  5. new
  6.     pingtimer;
  7.  
  8. public OnGameModeInit()
  9. {
  10.     pingtimer = SetTimer("CheckPing", 2000, 1);
  11.     return 1;
  12. }
  13.  
  14. public OnGameModeExit()
  15. {
  16.     KillTimer(pingtimer);
  17. }
  18.  
  19. public CheckPing()
  20. {
  21.     for (new i; i < MAX_PLAYERS; ++i)
  22.     {
  23.         if (IsPlayerConnected(i) && GetPlayerPing(i) > MAX_PING && GetPlayerState(i) != PLAYER_STATE_NONE)
  24.         {
  25.             SendClientMessage(i, 0xFF000000, "You have been kicked for exceeding the ping limit of "#MAX_PING"");
  26.             Kick(i);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment