hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.23. 12:32



Jelenlévő felhasználók

Jelenleg 158 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 156 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Magas ping
HozzászólásElküldve: 2014.08.23. 12:43 
Offline
Senior Tag

Csatlakozott: 2013.07.29. 13:15
Hozzászólások: 233
Megköszönt másnak: 125 alkalommal
Halló. Valaki eszt a plugint megcsinálná ugy hogy chatba mikor aszt írja hogy "[HPK] Akinek magasabb a ping-je %d -nel a szerver kirugja automatikusan" [HPK] %d ezt a 2 részt pirossal írja a többit zöldell!! ennél a chat üzenetnél
"[HPK] Jatekos %s kirugva magas ping miatt!" a név legyen piros ehát ez %s és ez is piros [HPK] a többi zöldel írja
aki elkészíti megy a gomb!!!


SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. new const PLUGIN[] = "High Ping Kicker"
  5. new const VERSION[] = "1.0"
  6. new const AUTHOR[] = "Shadow/Bo0m!"
  7.  
  8. // Feel free to change this flag
  9. #define HPK_IMMUNE ADMIN_IMMUNITY
  10.  
  11. // PCvars
  12. new hpk_ping, hpk_check, hpk_tests, hpk_delay, hpk_immunity
  13.  
  14. new g_Ping[33]
  15. new g_Samples[33]
  16.  
  17. public plugin_init() {
  18.  
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20.  
  21. register_concmd("amx_hpk","cmdHpk",ADMIN_CVAR,"- configures high ping kicker")
  22.  
  23. hpk_ping = register_cvar("amx_hpk_ping","90")
  24. hpk_check = register_cvar("amx_hpk_check","10")
  25. hpk_tests = register_cvar("amx_hpk_tests","3")
  26. hpk_delay = register_cvar("amx_hpk_delay","30")
  27. hpk_immunity = register_cvar("amx_hpk_immunity","0")
  28.  
  29. if (get_pcvar_num(hpk_check) < 5) set_pcvar_num(hpk_check,5)
  30. if (get_pcvar_num(hpk_tests) < 3) set_pcvar_num(hpk_tests,3)
  31. }
  32.  
  33. public client_disconnect(id)
  34. remove_task(id)
  35.  
  36. public client_putinserver(id) {
  37. g_Ping[id] = 0
  38. g_Samples[id] = 0
  39.  
  40. if ( !is_user_bot(id) )
  41. {
  42. new param[1]
  43. param[0] = id
  44. set_task( 15.0 , "showWarn" , id , param , 1 )
  45.  
  46. if (get_pcvar_num(hpk_delay) != 0) {
  47. set_task( float(get_pcvar_num(hpk_delay)), "taskSetting", id, param , 1)
  48. }
  49. else {
  50. set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , id , param , 1 , "b" )
  51. }
  52. }
  53. }
  54.  
  55. public showWarn(param[])
  56. client_print( param[0] ,print_chat,"[HPK] Akinek magasabb a ping-je %d -nel a szerver kirugja automatikusan!", get_cvar_num( "amx_hpk_ping" ) )
  57.  
  58. public taskSetting(param[]) {
  59. new name[32]
  60. get_user_name(param[0],name,31)
  61. set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , param[0] , param , 1 , "b" )
  62. }
  63.  
  64. kickPlayer(id) {
  65. new name[32],authid[36]
  66. get_user_name(id,name,31)
  67. get_user_authid(id,authid,35)
  68. client_print(0,print_chat,"[HPK] Jatekos %s kirugva magas ping miatt!!",name)
  69. server_cmd("kick #%d ^"A pinged tul magas.Ne torrentezz!!...^"",get_user_userid(id))
  70. log_amx("HPK: ^"%s<%d><%s>^" kirugva magas ping miatt (Atlagos Ping ^"%d^")", name,get_user_userid(id),authid,(g_Ping[id] / g_Samples[id]))
  71. }
  72.  
  73. public checkPing(param[]) {
  74.  
  75. if (get_pcvar_num(hpk_tests) < 3)
  76. set_pcvar_num(hpk_tests,3)
  77.  
  78. new id = param[ 0 ]
  79.  
  80. if ( get_user_flags(id) & HPK_IMMUNE && get_pcvar_num(hpk_immunity) == 1 ) {
  81. remove_task(id)
  82. client_print(id, print_chat, "[HPK] Ping ellenorzes leallitva mert admin van fent a szerveren!")
  83. return PLUGIN_CONTINUE
  84. }
  85.  
  86. new ping, loss
  87.  
  88. get_user_ping(id,ping,loss)
  89.  
  90. g_Ping[ id ] += ping
  91. ++g_Samples[ id ]
  92.  
  93. if ( (g_Samples[ id ] > get_pcvar_num(hpk_tests)) && (g_Ping[id] / g_Samples[id] > get_pcvar_num(hpk_ping)) )
  94. kickPlayer(id)
  95.  
  96. return PLUGIN_CONTINUE
  97. }
  98.  
  99.  
  100. public cmdHpk(id,level,cid) {
  101. if (!cmd_access(id,level,cid,1))
  102. return PLUGIN_HANDLED
  103.  
  104. if (read_argc() < 6) {
  105. console_print(id,"Hasznalat: amx_hpk <max ping> <total ping checks> <time between checks> <delay before starting checks> <1 to allow immunity|0 to disallow")
  106. console_print(id,"A kovetkezo HPK beallitasok:")
  107. console_print(id,"Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d",get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  108. return PLUGIN_HANDLED
  109. }
  110.  
  111. new name[32], authid[36]
  112. get_user_name(id,name,31)
  113. get_user_authid(id,authid,35)
  114.  
  115. new ping_arg[5], check_arg[5], tests_arg[5], delay_arg[5], immune_arg[5]
  116. read_argv(1,ping_arg,4)
  117. read_argv(2,tests_arg,4)
  118. read_argv(3,check_arg,4)
  119. read_argv(4,delay_arg,4)
  120. read_argv(5,immune_arg,4)
  121.  
  122. new ping = str_to_num(ping_arg)
  123. new tests = str_to_num(tests_arg)
  124. new check = str_to_num(check_arg)
  125. new delay = str_to_num(delay_arg)
  126. new immune = str_to_num(immune_arg)
  127.  
  128. if ( check < 5 ) check = 5
  129. if ( tests < 3 ) tests = 3
  130.  
  131. set_pcvar_num(hpk_ping,ping)
  132. set_pcvar_num(hpk_tests,tests)
  133. set_pcvar_num(hpk_check,check)
  134. set_pcvar_num(hpk_delay,delay)
  135. set_pcvar_num(hpk_immunity,immune)
  136.  
  137. console_print(id,"A kovetkezo HPK beallitasok:")
  138. console_print(id,"Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d",get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  139. log_amx("HPK: ^"%s<%d><%s>^" igy lettek beallitva - Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d", name,get_user_userid(id),authid,get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  140.  
  141. return PLUGIN_HANDLED
  142. }
  143.  
  144.  
  145.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Magas ping
HozzászólásElküldve: 2014.08.23. 12:57 
Tessék:
Kód:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size:            716 bytes
Code size:             6520 bytes
Data size:             4796 bytes
Stack/heap size:      16384 bytes; estimated max. usage=781 cells (3124 bytes)
Total requirements:   28416 bytes
Done.

SMX Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. new const PLUGIN[] = "High Ping Kicker"
  5. new const VERSION[] = "1.0"
  6. new const AUTHOR[] = "Shadow/Bo0m!"
  7.  
  8. // Feel free to change this flag
  9. #define HPK_IMMUNE ADMIN_IMMUNITY
  10.  
  11. // PCvars
  12. new hpk_ping, hpk_check, hpk_tests, hpk_delay, hpk_immunity
  13.  
  14. new g_Ping[33]
  15. new g_Samples[33]
  16.  
  17. public plugin_init() {
  18.  
  19. register_plugin(PLUGIN, VERSION, AUTHOR)
  20.  
  21. register_concmd("amx_hpk","cmdHpk",ADMIN_CVAR,"- configures high ping kicker")
  22.  
  23. hpk_ping = register_cvar("amx_hpk_ping","90")
  24. hpk_check = register_cvar("amx_hpk_check","10")
  25. hpk_tests = register_cvar("amx_hpk_tests","3")
  26. hpk_delay = register_cvar("amx_hpk_delay","30")
  27. hpk_immunity = register_cvar("amx_hpk_immunity","0")
  28.  
  29. if (get_pcvar_num(hpk_check) < 5) set_pcvar_num(hpk_check,5)
  30. if (get_pcvar_num(hpk_tests) < 3) set_pcvar_num(hpk_tests,3)
  31. }
  32.  
  33. public client_disconnect(id)
  34. remove_task(id)
  35.  
  36. public client_putinserver(id) {
  37. g_Ping[id] = 0
  38. g_Samples[id] = 0
  39.  
  40. if ( !is_user_bot(id) )
  41. {
  42. new param[1]
  43. param[0] = id
  44. set_task( 15.0 , "showWarn" , id , param , 1 )
  45.  
  46. if (get_pcvar_num(hpk_delay) != 0) {
  47. set_task( float(get_pcvar_num(hpk_delay)), "taskSetting", id, param , 1)
  48. }
  49. else {
  50. set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , id , param , 1 , "b" )
  51. }
  52. }
  53. }
  54.  
  55. public showWarn(param[])
  56. client_print( param[0] ,print_chat,"!t[HPK] !gAkinek magasabb a ping-je !t%d !g-nel a szerver kirugja automatikusan!", get_cvar_num( "amx_hpk_ping" ) )
  57.  
  58. public taskSetting(param[]) {
  59. new name[32]
  60. get_user_name(param[0],name,31)
  61. set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , param[0] , param , 1 , "b" )
  62. }
  63.  
  64. kickPlayer(id) {
  65. new name[32],authid[36]
  66. get_user_name(id,name,31)
  67. get_user_authid(id,authid,35)
  68. client_print(0,print_chat,"!t[HPK] !gJatekos !t%s !gkirugva magas ping miatt!!",name)
  69. server_cmd("kick #%d ^"A pinged tul magas.Ne torrentezz!!...^"",get_user_userid(id))
  70. log_amx("HPK: ^"%s<%d><%s>^" kirugva magas ping miatt (Atlagos Ping ^"%d^")", name,get_user_userid(id),authid,(g_Ping[id] / g_Samples[id]))
  71. }
  72.  
  73. public checkPing(param[]) {
  74.  
  75. if (get_pcvar_num(hpk_tests) < 3)
  76. set_pcvar_num(hpk_tests,3)
  77.  
  78. new id = param[ 0 ]
  79.  
  80. if ( get_user_flags(id) & HPK_IMMUNE && get_pcvar_num(hpk_immunity) == 1 ) {
  81. remove_task(id)
  82. client_print(id, print_chat, "[HPK] Ping ellenorzes leallitva mert admin van fent a szerveren!")
  83. return PLUGIN_CONTINUE
  84. }
  85.  
  86. new ping, loss
  87.  
  88. get_user_ping(id,ping,loss)
  89.  
  90. g_Ping[ id ] += ping
  91. ++g_Samples[ id ]
  92.  
  93. if ( (g_Samples[ id ] > get_pcvar_num(hpk_tests)) && (g_Ping[id] / g_Samples[id] > get_pcvar_num(hpk_ping)) )
  94. kickPlayer(id)
  95.  
  96. return PLUGIN_CONTINUE
  97. }
  98.  
  99.  
  100. public cmdHpk(id,level,cid) {
  101. if (!cmd_access(id,level,cid,1))
  102. return PLUGIN_HANDLED
  103.  
  104. if (read_argc() < 6) {
  105. console_print(id,"Hasznalat: amx_hpk <max ping> <total ping checks> <time between checks> <delay before starting checks> <1 to allow immunity|0 to disallow")
  106. console_print(id,"A kovetkezo HPK beallitasok:")
  107. console_print(id,"Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d",get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  108. return PLUGIN_HANDLED
  109. }
  110.  
  111. new name[32], authid[36]
  112. get_user_name(id,name,31)
  113. get_user_authid(id,authid,35)
  114.  
  115. new ping_arg[5], check_arg[5], tests_arg[5], delay_arg[5], immune_arg[5]
  116. read_argv(1,ping_arg,4)
  117. read_argv(2,tests_arg,4)
  118. read_argv(3,check_arg,4)
  119. read_argv(4,delay_arg,4)
  120. read_argv(5,immune_arg,4)
  121.  
  122. new ping = str_to_num(ping_arg)
  123. new tests = str_to_num(tests_arg)
  124. new check = str_to_num(check_arg)
  125. new delay = str_to_num(delay_arg)
  126. new immune = str_to_num(immune_arg)
  127.  
  128. if ( check < 5 ) check = 5
  129. if ( tests < 3 ) tests = 3
  130.  
  131. set_pcvar_num(hpk_ping,ping)
  132. set_pcvar_num(hpk_tests,tests)
  133. set_pcvar_num(hpk_check,check)
  134. set_pcvar_num(hpk_delay,delay)
  135. set_pcvar_num(hpk_immunity,immune)
  136.  
  137. console_print(id,"A kovetkezo HPK beallitasok:")
  138. console_print(id,"Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d",get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  139. log_amx("HPK: ^"%s<%d><%s>^" igy lettek beallitva - Max Ping: %d | Ping ellenorzesek: %d | Ellenorzesek szama: %d | Ellenorzes inditasa: %d | Admin vedetseg: %d", name,get_user_userid(id),authid,get_pcvar_num(hpk_ping),get_pcvar_num(hpk_tests),get_pcvar_num(hpk_check),get_pcvar_num(hpk_delay),get_pcvar_num(hpk_immunity))
  140.  
  141. return PLUGIN_HANDLED
  142. }
  143. stock print_color(const id, const input[], any:...)
  144. {
  145. new count = 1, players[32]
  146. static msg[191]
  147. vformat(msg, 190, input, 3)
  148.  
  149. replace_all(msg, 190, "!g", "^4")
  150. replace_all(msg, 190, "!y", "^1")
  151. replace_all(msg, 190, "!t", "^3")
  152. replace_all(msg, 190, "á", "á")
  153. replace_all(msg, 190, "é", "Ă©")
  154. replace_all(msg, 190, "í", "Ă­")
  155. replace_all(msg, 190, "ó", "Ăł")
  156. replace_all(msg, 190, "ö", "ö")
  157. replace_all(msg, 190, "ő", "Ĺ‘")
  158. replace_all(msg, 190, "ú", "Ăş")
  159. replace_all(msg, 190, "ü", "ĂĽ")
  160. replace_all(msg, 190, "ű", "ű")
  161. replace_all(msg, 190, "Á", "Á")
  162. replace_all(msg, 190, "É", "É")
  163. replace_all(msg, 190, "Í", "ĂŤ")
  164. replace_all(msg, 190, "Ó", "Ă“")
  165. replace_all(msg, 190, "Ö", "Ă–")
  166. replace_all(msg, 190, "Ő", "Ő")
  167. replace_all(msg, 190, "Ú", "Ăš")
  168. replace_all(msg, 190, "Ü", "Ăś")
  169. replace_all(msg, 190, "Ű", "Ĺ°")
  170.  
  171. if (id) players[0] = id; else get_players(players, count, "ch")
  172. {
  173. for (new i = 0; i < count; i++)
  174. {
  175. if (is_user_connected(players[i]))
  176. {
  177. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  178. write_byte(players[i])
  179. write_string(msg)
  180. message_end()
  181. }
  182. }
  183. }
  184. return PLUGIN_HANDLED
  185. }
  186.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Magas ping
HozzászólásElküldve: 2014.08.23. 13:21 
Offline
Fanatikus
Avatar

Csatlakozott: 2014.08.21. 19:30
Hozzászólások: 182
Megköszönt másnak: 3 alkalommal
Megköszönték neki: 41 alkalommal
Elolvastam a szabályzatot, tudom hogy Tilos az Off!

Ő nem ezt kérte ha jól értelmeztem a kérvényt. Ő azt kérte hogy pirossal írja ki a Plug-In. E helyett, a CT csapatnak kékkel lesz látható, míg a T nek pirossal. Ha jól tudom, olyat is lehet hogy mind a T nek, mind a CT nek Pirossal írja.
Elnézést az Offért, bizonyára a válasz adó félre olvasta a kérdező Hozzászólását.

További szép napot!


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Magas ping
HozzászólásElküldve: 2014.08.23. 13:39 
nem tudom én ugy nem értek hozzá anyira én meg probáltam !! :evil:
ha jo lesz neki akkor jo ha nem akkor nem
:evil: :evil: :evil:


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Magas ping
HozzászólásElküldve: 2014.08.24. 11:34 
Offline
Tud valamit

Csatlakozott: 2014.08.22. 10:32
Hozzászólások: 144
Megköszönt másnak: 12 alkalommal
Megköszönték neki: 9 alkalommal
Tessék:
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod script
  2.  
  3.  
  4. *
  5. * (c) 2002-2003, DynAstY
  6. * This file is provided as is (no warranties).
  7. *
  8. * Players with immunity won't be checked
  9. */
  10.  
  11. #include <amxmodx>
  12. #include <colorchat>
  13.  
  14. new HIGHPING_MAX = 150 // set maximal acceptable ping
  15. new HIGHPING_TIME = 5 // set in seconds frequency of ping checking
  16. new HIGHPING_TESTS = 4 // minimal number of checks before doing anything
  17.  
  18. new iNumTests[33]
  19.  
  20. public plugin_init() {
  21. register_plugin("High Ping Kicker","1.2.0","DynAstY")
  22. if (HIGHPING_TIME < 15) HIGHPING_TIME = 15
  23. if (HIGHPING_TESTS < 4) HIGHPING_TESTS = 4
  24. return PLUGIN_CONTINUE
  25. }
  26.  
  27. public client_disconnect(id) {
  28. remove_task(id)
  29. return PLUGIN_CONTINUE
  30. }
  31.  
  32. public client_putinserver(id) {
  33. iNumTests[id] = 0
  34. if (!is_user_bot(id)) {
  35. new param[1]
  36. param[0] = id
  37. set_task(30.0, "showWarn", id, param, 1)
  38. }
  39. return PLUGIN_CONTINUE
  40. }
  41.  
  42. kickPlayer(id) {
  43. new name[32]
  44. get_user_name(id, name, 31)
  45. new uID = get_user_userid(id)
  46. server_cmd("banid 1 #%d", uID)
  47. client_cmd(id, "echo ^"[HPK] Lecsatlakozva, a magas ping miatt!^"; disconnect")
  48. ColorChat(0, RED, "[HPK] %s ^4lecsatlakoztatva, magas ping-je miatt!", name)
  49. return PLUGIN_CONTINUE
  50. }
  51.  
  52. public checkPing(param[]) {
  53. new id = param[0]
  54. if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
  55. remove_task(id)
  56. client_print(id, print_chat, "[HPK] Ping Ellenorzes Letiltva Inmunissag Miatt...")
  57. return PLUGIN_CONTINUE
  58. }
  59. new p, l
  60. get_user_ping(id, p, l)
  61. if (p > HIGHPING_MAX)
  62. ++iNumTests[id]
  63. else
  64. if (iNumTests[id] > 0) --iNumTests[id]
  65. if (iNumTests[id] > HIGHPING_TESTS)
  66. kickPlayer(id)
  67. return PLUGIN_CONTINUE
  68. }
  69.  
  70. public showWarn(param[]) {
  71. ColorChat(param[0], RED, "[HPK] ^4Akinek magasabb a pingje ^3%d-nel, ^4nem jatszhat a szerveren!", HIGHPING_MAX)
  72. set_task(float(HIGHPING_TIME), "checkPing", param[0], param, 1, "b")
  73. return PLUGIN_CONTINUE
  74. }
  75.  
  76. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  77. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  78. */
  79.  


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 3 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole