Advertisement
Guest User

&. Fully controlable Anty high ping by Patryk Skibinski

a guest
Jun 13th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. /*
  3. &. Fully controlable Anty high ping by Patryk Skibinski
  4. */
  5.  
  6. #include <a_samp>
  7. #include <zcmd>
  8.  
  9. /*
  10. &. Our variables and a small something that will make our code look more attractive...
  11. */
  12.  
  13. new a_Ping, m_Ping;
  14.  
  15. #if defined FILTERSCRIPT
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. print("&. W pe³ni kontrolowany Anty high ping stworzony przez Patryk Skibinski");
  20. SetTimer("Check", 1000, 1);
  21. return 1;
  22. }
  23.  
  24. #else
  25.  
  26. main()
  27. {
  28. print("&. W pe³ni kontrolowany Anty high ping stworzony przez Patryk Skibinski");
  29. }
  30.  
  31. #endif
  32.  
  33. /*
  34. &. All of the responses to the dialogs, which we have displayed in our administrator command
  35. */
  36.  
  37. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  38. {
  39. if(dialogid == 69 && response)
  40. {
  41. switch(listitem)
  42. {
  43. case 0:
  44. {
  45. if(a_Ping == 0)
  46. {
  47. a_Ping = 1, m_Ping = 500, SendClientMessage(playerid,-1,"Anty ping zosta³ w³¹czony.");
  48. }
  49. else a_Ping = 0, m_Ping = 0, SendClientMessage(playerid,-1,"Anty ping zosta³ wy³¹czony.");
  50. }
  51. case 1:
  52. {
  53. ShowPlayerDialog(playerid, 666, DIALOG_STYLE_INPUT, "&. Panel Kontroli", "&. Zmieñ maks. ping\n&. Minimum 100", "Ustaw", "Anuluj");
  54. }
  55. }
  56. }
  57.  
  58. if(dialogid == 666 && response)
  59. {
  60. if(strlen(inputtext) <= 99) return ShowPlayerDialog(playerid, 666, DIALOG_STYLE_INPUT, "&. Panel Kontroli", "&. Zmieñ maks. ping\n&. Minimum 100", "Ustaw", "Anuluj");
  61. m_Ping = strval(inputtext);
  62. SendClientMessage(playerid,-1,"Zmieni³eœ wartoœc MAX PING.");
  63. }
  64. return 1;
  65. }
  66.  
  67. /*
  68. &. Commands for the administrator
  69. */
  70.  
  71. CMD:ping(playerid, params[])
  72. {
  73. if(IsPlayerAdmin(playerid))
  74. {
  75. ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "&. Panel Kontroli", "&. Uruchom/Wylacz\n&. Zmieñ maks. iloœc ping", "Wybierz", "Anuluj");
  76. }
  77. else SendClientMessage(playerid, -1, "&. Nie masz dostêpu.");
  78. return 1;
  79. }
  80.  
  81. /*
  82. &. Our public which will check if the player's ping is or isn't too high
  83. */
  84.  
  85. forward Check(playerid);
  86. public Check(playerid)
  87. {
  88. for(new i = 0; i < GetMaxPlayers(); i++)
  89. {
  90. if(a_Ping == 1 && GetPlayerPing(i) >= m_Ping)
  91. {
  92. Kick(i);
  93. }
  94. }
  95. return 1;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement