Advertisement
Guii12034589

Untitled

Jul 22nd, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #if defined AntPing
  2.  
  3. Criado Por R7TL; \o/
  4.  
  5. #endif
  6.  
  7. #include a_samp
  8.  
  9. #define MAX_PING 580
  10. #define ATRASO 5
  11. #define pingk 1541
  12.  
  13. new PKPPing[ MAX_PLAYERS ];
  14.  
  15. public OnFilterScriptInit()
  16. {
  17. SetTimer("VerificarPing", 1000*5, true);
  18. return 1;
  19. }
  20. public OnPlayerConnect(playerid)
  21. {
  22. PKPPing[playerid] = 0;
  23. return 1;
  24. }
  25.  
  26. forward VerificarPing();
  27. public VerificarPing()
  28. {
  29. new string[128];
  30. new pPing;
  31.  
  32. for(new i = 0; i < MAX_PLAYERS; i++)
  33. {
  34. if(IsPlayerConnected(i))
  35. {
  36. pPing = GetPlayerPing(i);
  37. if(pPing > MAX_PING)
  38. {
  39. PKPPing[i]++;
  40.  
  41. if( PKPPing[i] == ATRASO )
  42. {
  43. format( string, sizeof( string ), "|PING| O jogador %s foi kickado por estar acima do ping permitido: (%d)", PKPName( i ), pPing);
  44. SendClientMessageToAll( -1, string );
  45. SendClientMessage(i, 0xFFFFFF, "|PING| Você foi kickado por estar acima do Ping Permitido!");
  46. SendClientMessage(i, 0xFFFFFF, "|PING| Assim acarretando possíveis lag's no servidor.");
  47. Kick(i);
  48. }
  49. }
  50. }
  51. }
  52. }
  53.  
  54. stock PKPName( playerid )
  55. {
  56. new pName[MAX_PLAYER_NAME];
  57. GetPlayerName(playerid, pName, sizeof(pName));
  58. return pName;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement