hlmod.hu
https://hlmod.hu/

Javitaná valaki? :)
https://hlmod.hu/viewtopic.php?f=10&t=18809
Oldal: 1 / 2

Szerző:  Be$t.# [ 2015.01.02. 18:51 ]
Hozzászólás témája:  Javitaná valaki? :)

Hahii!
Valaki ki javítaná? :)
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. ColorChat( param[0] , RED, "^3Cho$-Te@m Akinek magasabb a ping-je ^4%d ^1-^3nel az mehet a picsába!", 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. ColorChat(0, RED, "^3Cho$-Te@m ^1Jatekos ^4%s ^4kirugva magas ping miatt!!",name)
  69. server_cmd("kick #%d ^"A pinged tul magas Ne Nézz Kecskepornot!^"",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, "^4[^3Cho$-Te@m^4] ^3Ping ellenörzés 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.  

Szerző:  Hydra ツ [ 2015.01.02. 19:03 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

colorchat includét kihagytad :)
SMA Forráskód: [ Mindet kijelol ]
  1. #include <colorchat>


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

Szerző:  Be$t.# [ 2015.01.02. 19:04 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

jaj nem figyeletm,mivel hlmodon forditok!

Szerző:  Hydra ツ [ 2015.01.02. 19:06 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

Be$t.# írta:
jaj nem figyeletm,mivel hlmodon forditok!


http://aghl.ru/webcompiler/webcompiler.php

Ez kiírja a hibákat.

Szerző:  Be$t.# [ 2015.01.02. 19:22 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

tudom,csak ne ékezesiti le! :) És nem kinlodok még utf8 al!

Szerző:  zolee007 [ 2015.02.09. 18:42 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

nekem is ez van meg azt hogy lehet be állítani hogy ne írja ki sűrűn?,mert most szinte folyamatosan írja

Szerző:  GameFather [ 2015.02.09. 18:46 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

zolee007 írta:
nekem is ez van meg azt hogy lehet be állítani hogy ne írja ki sűrűn?,mert most szinte folyamatosan írja


Ugyan ez van vagy te már módsítótadó, ha módosított akkor másold be.

Szerző:  zolee007 [ 2015.02.09. 18:46 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

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","70")
  24. hpk_check = register_cvar("amx_hpk_check","10")
  25. hpk_tests = register_cvar("amx_hpk_tests","1")
  26. hpk_delay = register_cvar("amx_hpk_delay","30")
  27. hpk_immunity = register_cvar("amx_hpk_immunity","1")
  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. print_color(0, "!t[AK26] !yAkinek magasabb a ping-je!g %d -nel !ta 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, "[AK26] 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. stock print_color(const id, const input[], any:...)
  146. {
  147. new count = 1, players[32]
  148. static msg[191]
  149. vformat(msg, 190, input, 3)
  150.  
  151. replace_all(msg, 190, "!g", "^4")
  152. replace_all(msg, 190, "!y", "^1")
  153. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "Ü", "Ăś")
  171. replace_all(msg, 190, "Ű", "Ĺ°")
  172.  
  173. if (id) players[0] = id; else get_players(players, count, "ch")
  174. {
  175. for (new i = 0; i < count; i++)
  176. {
  177. if (is_user_connected(players[i]))
  178. {
  179. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  180. write_byte(players[i])
  181. write_string(msg)
  182. message_end()
  183. }
  184. }
  185. }
  186. return PLUGIN_HANDLED
  187. }

Szerző:  GameFather [ 2015.02.09. 18:51 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

[ablak]
zolee007 írta:
SMA Forráskód: [ Mindet kijelol ] #include <amxmodx>
#include <amxmisc>
 
new const PLUGIN[] = "High Ping Kicker"
new const VERSION[] = "1.0"
new const AUTHOR[] = "Shadow/Bo0m!"
 
// Feel free to change this flag
#define HPK_IMMUNE ADMIN_IMMUNITY
 
// PCvars
new hpk_ping, hpk_check, hpk_tests, hpk_delay, hpk_immunity
 
new g_Ping[33]
new g_Samples[33]
 
public plugin_init() {
 
register_plugin(PLUGIN, VERSION, AUTHOR)
 
register_concmd("amx_hpk","cmdHpk",ADMIN_CVAR,"- configures high ping kicker")
 
hpk_ping = register_cvar("amx_hpk_ping","70")
hpk_check = register_cvar("amx_hpk_check","10")
hpk_tests = register_cvar("amx_hpk_tests","1")
hpk_delay = register_cvar("amx_hpk_delay","30")
hpk_immunity = register_cvar("amx_hpk_immunity","1")
 
if (get_pcvar_num(hpk_check) < 5) set_pcvar_num(hpk_check,5)
if (get_pcvar_num(hpk_tests) < 3) set_pcvar_num(hpk_tests,3)
}
 
public client_disconnect(id)
remove_task(id)
 
public client_putinserver(id) {
g_Ping[id] = 0
g_Samples[id] = 0
 
if ( !is_user_bot(id) )
{
new param[1]
param[0] = id
set_task( 15.0 , "showWarn" , id , param , 1 )
 
if (get_pcvar_num(hpk_delay) != 0) {
set_task( float(get_pcvar_num(hpk_delay)), "taskSetting", id, param , 1)
}
else {
set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , id , param , 1 , "b" )
}
}
}
 
public showWarn(param[])
print_color(0, "!t[AK26] !yAkinek magasabb a ping-je!g %d -nel !ta szerver kirugja automatikusan!", get_cvar_num( "amx_hpk_ping" ) )
 
public taskSetting(param[]) {
new name[32]
get_user_name(param[0],name,31)
set_task( float(get_pcvar_num(hpk_check)) , "checkPing" , param[0] , param , 1 , "b" )
}
 
kickPlayer(id) {
new name[32],authid[36]
get_user_name(id,name,31)
get_user_authid(id,authid,35)
client_print(0,print_chat,"[HPK] Jatekos %s kirugva magas ping miatt!!",name)
server_cmd("kick #%d ^"A pinged tul magas.Ne torrentezz!!...^"",get_user_userid(id))
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]))
}
 
public checkPing(param[]) {
 
if (get_pcvar_num(hpk_tests) < 3)
set_pcvar_num(hpk_tests,3)
 
new id = param[ 0 ]
 
if ( get_user_flags(id) & HPK_IMMUNE && get_pcvar_num(hpk_immunity) == 1 ) {
remove_task(id)
client_print(id, print_chat, "[AK26] Ping ellenorzes leallitva mert admin van fent a szerveren!")
return PLUGIN_CONTINUE
}
 
new ping, loss
 
get_user_ping(id,ping,loss)
 
g_Ping[ id ] += ping
++g_Samples[ id ]
 
if ( (g_Samples[ id ] > get_pcvar_num(hpk_tests)) && (g_Ping[id] / g_Samples[id] > get_pcvar_num(hpk_ping)) )
kickPlayer(id)
 
return PLUGIN_CONTINUE
}
 
 
public cmdHpk(id,level,cid) {
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
 
if (read_argc() < 6) {
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")
console_print(id,"A kovetkezo HPK beallitasok:")
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))
return PLUGIN_HANDLED
}
 
new name[32], authid[36]
get_user_name(id,name,31)
get_user_authid(id,authid,35)
 
new ping_arg[5], check_arg[5], tests_arg[5], delay_arg[5], immune_arg[5]
read_argv(1,ping_arg,4)
read_argv(2,tests_arg,4)
read_argv(3,check_arg,4)
read_argv(4,delay_arg,4)
read_argv(5,immune_arg,4)
 
new ping = str_to_num(ping_arg)
new tests = str_to_num(tests_arg)
new check = str_to_num(check_arg)
new delay = str_to_num(delay_arg)
new immune = str_to_num(immune_arg)
 
if ( check < 5 ) check = 5
if ( tests < 3 ) tests = 3
 
set_pcvar_num(hpk_ping,ping)
set_pcvar_num(hpk_tests,tests)
set_pcvar_num(hpk_check,check)
set_pcvar_num(hpk_delay,delay)
set_pcvar_num(hpk_immunity,immune)
 
console_print(id,"A kovetkezo HPK beallitasok:")
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))
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))
 
return PLUGIN_HANDLED
}
 
 
stock print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
 
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "á", "á")
replace_all(msg, 190, "é", "Ă©")
replace_all(msg, 190, "í", "Ă­")
replace_all(msg, 190, "ó", "Ăł")
replace_all(msg, 190, "ö", "ö")
replace_all(msg, 190, "ő", "Ĺ‘")
replace_all(msg, 190, "ú", "Ăş")
replace_all(msg, 190, "ü", "ĂĽ")
replace_all(msg, 190, "ű", "ű")
replace_all(msg, 190, "Á", "Á")
replace_all(msg, 190, "É", "É")
replace_all(msg, 190, "Í", "ĂŤ")
replace_all(msg, 190, "Ó", "Ă“")
replace_all(msg, 190, "Ö", "Ă–")
replace_all(msg, 190, "Ő", "Ő")
replace_all(msg, 190, "Ú", "Ăš")
replace_all(msg, 190, "Ü", "Ăś")
replace_all(msg, 190, "Ű", "Ĺ°")
 
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
return PLUGIN_HANDLED
}
[/ablak]

Try
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","70")
  24. hpk_check = register_cvar("amx_hpk_check","10")
  25. hpk_tests = register_cvar("amx_hpk_tests","1")
  26. hpk_delay = register_cvar("amx_hpk_delay","30")
  27. hpk_immunity = register_cvar("amx_hpk_immunity","1")
  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. print_color(param[0], "!t[AK26] !yAkinek magasabb a ping-je!g %d -nel !ta 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, "[AK26] 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. stock print_color(const id, const input[], any:...)
  146. {
  147. new count = 1, players[32]
  148. static msg[191]
  149. vformat(msg, 190, input, 3)
  150.  
  151. replace_all(msg, 190, "!g", "^4")
  152. replace_all(msg, 190, "!y", "^1")
  153. replace_all(msg, 190, "!t", "^3")
  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. replace_all(msg, 190, "Ü", "Ăś")
  171. replace_all(msg, 190, "Ű", "Ĺ°")
  172.  
  173. if (id) players[0] = id; else get_players(players, count, "ch")
  174. {
  175. for (new i = 0; i < count; i++)
  176. {
  177. if (is_user_connected(players[i]))
  178. {
  179. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  180. write_byte(players[i])
  181. write_string(msg)
  182. message_end()
  183. }
  184. }
  185. }
  186. return PLUGIN_HANDLED
  187. }

Szerző:  zolee007 [ 2015.02.10. 17:42 ]
Hozzászólás témája:  Re: Javitaná valaki? :)

jó csak 1x írja ki de viszont meg nem csinál semmit :S

Oldal: 1 / 2 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/