hlmod.hu
https://hlmod.hu/

Átírányítás
https://hlmod.hu/viewtopic.php?f=9&t=16152
Oldal: 1 / 1

Szerző:  Papi [ 2014.06.07. 15:28 ]
Hozzászólás témája:  Átírányítás

Sziasztok. Menyik is az a Plugin hogy amikor csatizol egy szeróra és Felérsz Egyből átírányit?

Szerző:  MISU1998 [ 2014.06.07. 15:31 ]
Hozzászólás témája:  Re: Átírányítás

Egyszerű átirányítás

Szerző:  norbee.16 [ 2014.06.08. 12:20 ]
Hozzászólás témája:  Re: Átírányítás

Steamost is átírányit.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Redirect_All"
  5. #define VERSION "1.7"
  6. #define AUTHOR "Vet(3TT3V)"
  7.  
  8. new g_enabled
  9. new g_IP
  10. new g_port
  11. new g_delay
  12. new g_ipcvar[32]
  13. new g_portcvar
  14.  
  15. public plugin_init()
  16. {
  17. g_enabled = register_cvar("redirect_enable", "1")
  18. g_IP = register_cvar("redirect_ip", "")
  19. g_port = register_cvar("redirect_port", "")
  20. g_delay = register_cvar("redirect_delay", "0.1")
  21.  
  22. register_plugin(PLUGIN, VERSION, AUTHOR)
  23.  
  24. if (!file_exists("motd.txt"))
  25. set_fail_state("motd.txt file not found")
  26.  
  27. if (!get_pcvar_num(g_enabled))
  28. set_fail_state("Plugin disabled by CVar")
  29.  
  30. get_pcvar_string(g_IP, g_ipcvar, 31)
  31. if (equal(g_ipcvar, ""))
  32. set_fail_state("Invalid server IP CVar")
  33.  
  34. g_portcvar = get_pcvar_num(g_port)
  35.  
  36. register_event("InitHUD", "event_InitHUD", "bd")
  37. register_message(get_user_msgid("VGUIMenu"), "show_vgui")
  38.  
  39. log_message("[AMXX] Redirect All - Plugin Initialized")
  40.  
  41. return PLUGIN_CONTINUE
  42. }
  43.  
  44. public event_InitHUD(id)
  45. {
  46. if (!is_user_bot(id) && !is_user_hltv(id) && !is_user_immune(id)) {
  47. set_task(0.1, "task_show_motd", id, "", 0, "b")
  48. console_print(id, "^n****************************")
  49. console_print(id, "* Atiranyitas")
  50. console_print(id, "* %s:%d^n*", g_ipcvar, g_portcvar)
  51. console_print(id, "* Mentsd el az ipt")
  52. console_print(id, "****************************^n")
  53. set_task(Float:get_pcvar_float(g_delay), "task_redirect", 100 + id)
  54. }
  55.  
  56. return PLUGIN_CONTINUE
  57. }
  58.  
  59. public client_disconnect(id)
  60. {
  61. remove_task(id)
  62. remove_task(100 + id)
  63. }
  64.  
  65. public task_show_motd(id)
  66. {
  67. if (is_user_connected(id))
  68. show_motd(id, "motd.txt")
  69. else {
  70. remove_task(id)
  71. remove_task(100 + id)
  72. }
  73. }
  74.  
  75. public task_redirect(tid)
  76. {
  77. new id = tid - 100
  78. new info1[32], info2[32]
  79. if (is_user_connected(id)) {
  80. get_user_name(id, info1, 31)
  81. get_user_authid(id, info2, 31)
  82. log_message("[Redirect] Sent %s <%s> to new server", info1, info2)
  83. client_cmd(id, ";^"Connect^" %s:%d", g_ipcvar, g_portcvar)
  84. }
  85. }
  86.  
  87. public show_vgui(msgid, dest, id)
  88. {
  89. if (is_user_immune(id))
  90. return PLUGIN_CONTINUE
  91.  
  92. return PLUGIN_HANDLED
  93. }
  94.  
  95. public is_user_immune(id)
  96. {
  97. new uname[32]
  98. get_user_name(id, uname, 31)
  99. if (get_user_flags(id) & ADMIN_IMMUNITY && equal(uname, "noredirect"))
  100. return 1
  101.  
  102. return 0
  103. }
  104.  

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