Advertisement
DraKiNs

[FS] Anti High Ping

Jun 26th, 2011
1,108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.17 KB | None | 0 0
  1. /*==============================================================================
  2.              _ ____        _____          __  __
  3.             (_)  _ \ ___  |_   _|__  __ _|  \/  |
  4.             | | |_) / __|   | |/ _ \/ _` | |\/| |
  5.             | |  __/\__ \   | |  __/ (_| | |  | |
  6.             |_|_|   |___/   |_|\___|\__,_|_|  |_|
  7.  
  8.                [iPs] Anti High Ping
  9.                 Criado por: [iPs]Crush
  10.                     Versão 0.1
  11. ==============================================================================*/
  12.  //By Crush and DraKiNs
  13.  
  14. #include <a_samp>
  15.  
  16. #define MaxPing 200 // Limite de Ping Aqui
  17.  
  18. public OnGameModeInit()
  19. {
  20.     SetTimer("OnPlayerUpPing", 1500, true);
  21.     return 1;
  22. }
  23.  
  24. OnPlayerUpPing(playerid);
  25. public OnPlayerUpPing(playerid)
  26. {
  27.     for(new i; i < MAX_PLAYERS; ++i)
  28.     {
  29.         if(!IsPlayerConnected(i) || GetPlayerPing(i) < MaxPing) continue;
  30.  
  31.         static
  32.             sString[128],
  33.             sName[MAX_PLAYER_NAME];
  34.  
  35.         GetPlayerName(i, sName, MAX_PLAYER_NAME);
  36.  
  37.         format(sString, 128, "[Info] O Player %s foi kickado por limite de ping excedido (limite %d)", sName, MaxPing);
  38.         SendClientMessageToAll(0xFF0000FF, sString);
  39.         Kick(i);
  40.     }
  41.     return true;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement