Advertisement
Guest User

Untitled

a guest
Aug 5th, 2013
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. new Pkickas[MAX_PLAYERS];
  2.  
  3. public OnGameModeInit()
  4. {
  5. SetTimer("AntiPing", 1000, true);
  6. return 1;
  7. }
  8. public OnPlayerConnect(playerid)
  9. {
  10. Pkickas[playerid] = 0;
  11. return 1;
  12. }
  13. public OnPlayerDisconnect(playerid, reason)
  14. {
  15. return 1;
  16. }
  17. forward AntiPing(playerid);
  18. public AntiPing(playerid)
  19. {
  20. for(new i=0;i<MAX_PLAYERS;i++)
  21. {
  22. if(IsPlayerConnected(i))
  23. {
  24. if(GetPlayerPing(i) > 400)
  25. {
  26. if(Pkickas[i] == 0)
  27. {
  28. Pkickas[i]++;
  29. SendClientMessage(i, -1, "[Serveris] Jūs gavote pirmajį įspėjimą. Prašome mažinti [PING]");
  30. }
  31. else if(Pkickas[i] == 1)
  32. {
  33. Pkickas[i]++;
  34. SendClientMessage(i, -1, "[Serveris] Jūs gavote antrajį įspėjimą. Prašome mažinti [PING]");
  35. }
  36. else if(Pkickas[i] == 2)
  37. {
  38. Pkickas[i]++;
  39. SendClientMessage(i, -1, "[Serveris] Jūs gavote trečiajį įspėjimą, ir esate išmestas iš serverio!");
  40. Kick(i);
  41. }
  42. }
  43. }
  44. }
  45. return 1;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement