Endorps

Anti High-Ping

Feb 13th, 2017
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAKSIMALAN_PING 1000
  4.  
  5. forward ProvjeriPing(playerid);
  6. new PingTajmer[MAX_PLAYERS];
  7.  
  8. public OnPlayerSpawn(playerid)
  9. {
  10. PingTajmer[playerid] = SetTimerEx("ProvjeriPing",1000,1,"i",playerid);
  11. return 1;
  12. }
  13.  
  14. public OnPlayerDisconnect(playerid, reason)
  15. {
  16. KillTimer(PingTajmer[playerid]);
  17. return 1;
  18. }
  19.  
  20. public ProvjeriPing(playerid)
  21. {
  22. if(GetPlayerPing(playerid) > MAKSIMALAN_PING) Kick(playerid);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment