Advertisement
Guest User

rwrwr

a guest
Mar 1st, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. forward PingKick();
  2. public PingKick()
  3. {
  4. if(ServerInfo[MaxPing] != 0)
  5. {
  6. PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;
  7.  
  8. for(new i=0; i<MAX_PLAYERS; i++)
  9. {
  10. PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);
  11.  
  12. if(GetPlayerPing(i) > ServerInfo[MaxPing])
  13. {
  14. if(PlayerInfo[i][PingCount] == 0) PlayerInfo[i][PingTime] = TimeStamp();
  15.  
  16. PlayerInfo[i][PingCount]++;
  17. if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
  18. {
  19. PlayerInfo[i][PingTime] = TimeStamp();
  20. PlayerInfo[i][PingCount] = 1;
  21. }
  22. else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
  23. {
  24. new Sum, x, string[128];
  25. while (x < PING_MAX_EXCEEDS) {
  26. Sum += PlayerInfo[i][pPing][x];
  27. x++;
  28. }
  29. format(string,sizeof(string),"%s has been kicked from the server. [Reason: High Ping %d | Max Allowed %d]", PlayerName2(i), GetPlayerPing(i), ServerInfo[MaxPing] );
  30. SendClientMessageToAll(red,string);
  31. SaveToFile("KickLog",string);
  32. Kick(i);
  33. }
  34. }
  35. else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
  36. {
  37. PlayerInfo[i][BotPing]++;
  38. if(PlayerInfo[i][BotPing] >= 3) BotCheck(i);
  39. }
  40. else
  41. {
  42. PlayerInfo[i][BotPing] = 0;
  43. }
  44. }
  45. }
  46.  
  47. #if defined ANTI_MINIGUN
  48. new weap, ammo;
  49. for(new i = 0; i < MAX_PLAYERS; i++)
  50. {
  51. if(IsPlayerConnected(i) && PlayerInfo[i][Level] == 0)
  52. {
  53. GetPlayerWeaponData(i, 7, weap, ammo);
  54. if(ammo > 1 && weap == 38) {
  55. new string[128]; format(string,sizeof(string),"INFO: %s has a mingun with %d ammo", PlayerName2(i), ammo);
  56. MessageToAdmins(COLOR_WHITE,string);
  57. }
  58. }
  59. }
  60. #endif
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement