HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  /* AMX Mod script
  2.  *
  3.  * RatesCheck v1.60 by pRED* Forditotta Anonymous1337
  4.  * -------------------------
  5.  *
  6.  * Prints the rates all all connected players into the console
  7.  * Rates checked are cl_cmdrate, cl_updaterate, rate, ex_interp
  8.  *
  9.  * Admin commands
  10.  * rates_list - displays a list of all players and their rates
  11.  */
  12.  
  13. #include <amxmodx>
  14. #include <amxmisc>
  15.  
  16. #define ADMIN_LEVEL ADMIN_SLAY
  17.  
  18. new name[32][32]
  19. new rate[32][32]
  20. new updaterate[32][32]
  21. new steamid[35][32]
  22. new cmdrate[32][32]
  23. new interp[32][32]
  24. new players[32]
  25. new num
  26.  
  27. public plugin_init() {
  28.  
  29. register_plugin("Rate Figyelo", "1.61", "pRED*")
  30.  
  31. register_concmd("rates_list", "rates_list", ADMIN_LEVEL, "Kijelzi minden jatekos Rate-jet.")
  32.  
  33. return PLUGIN_CONTINUE
  34. }
  35.  
  36.  
  37. public rates_list(id, level, cid) {
  38.  
  39. //Check if the user has the required access level
  40. if (!cmd_access(id,level,cid,1))
  41. return PLUGIN_HANDLED
  42.  
  43. //Print an info line to the users console
  44. client_print(id, print_console, "Rate lista generalasa Folyamatban..")
  45.  
  46. //Retrieve the rate information
  47. getrates(id)
  48.  
  49.  
  50.  
  51. //Wait 1 second for all query_client_cvar calls to finish the print rate info to console
  52. set_task(1.0, "printrates", id, "", 0, "a", 1)
  53.  
  54.  
  55. return PLUGIN_HANDLED
  56. }
  57.  
  58.  
  59. public cmdrate_result_func(id,const cvar[],const value[],const param[])
  60. {
  61. copy(cmdrate[param[0]],31,value)
  62.  
  63. }
  64.  
  65. public interp_result_func(id,const cvar[],const value[], const param[])
  66. {
  67. copy(interp[param[0]],31,value)
  68.  
  69. }
  70.  
  71. public getrates(id)
  72. {
  73. //Get Number of players in the server
  74. get_players(players,num,"c")
  75.  
  76. //Loop for all players and retrieve rate info
  77. for (new i[1] = 0; i[0] < num; ++i[0]) {
  78.  
  79. query_client_cvar(players[i[0]],"cl_cmdrate","cmdrate_result_func",1,i)
  80. query_client_cvar(players[i[0]],"ex_interp","interp_result_func",1,i)
  81.  
  82. set_task(0.5, "getinforates", i[0], "", 0, "a", 1) //Wait for 0.5 seconds for cvar quering to finish then get the rest of the info
  83.  
  84. }
  85.  
  86. }
  87.  
  88.  
  89. public getinforates(i)
  90. {
  91. get_user_name(players[i], name[i], 31)
  92. get_user_authid(players[i], steamid[i], 34);
  93. get_user_info(players[i], "rate", rate[i], 31)
  94. get_user_info(players[i], "cl_updaterate", updaterate[i], 31)
  95. }
  96.  
  97. public printrates(id)
  98. {
  99. //Print an info line to the users console
  100. client_print(id, print_console, "| ID | NEV | Steam_ID | Rate | Updaterate | Cmdrate | Ex_Interp |")
  101.  
  102. //Loop for all players and print rates info
  103. for (new i = 0; i < num; ++i) {
  104. client_print(id, print_console, "| #%d | %s | %s | %s | %s | %s | %s |",players[i],name[i], steamid[i], rate[i], updaterate[i], cmdrate[i], interp[i])
  105.  
  106. }
  107.  
  108. }