hlmod.hu
https://hlmod.hu/

Hirdetes
https://hlmod.hu/viewtopic.php?f=29&t=8503
Oldal: 1 / 1

Szerző:  metalpatrik [ 2013.05.14. 21:51 ]
Hozzászólás témája:  Hirdetes

Sziasztok egy olyan hirdetes tilto szeretnek amikor valaki ir 1 ip-t akkor azt a többiek ne lássák és a szerver figyelmeztesse hogy "A szerveren TILOS hirdetni! előre is köszi! :)

Szerző:  lbalazs96 [ 2013.05.14. 22:00 ]
Hozzászólás témája:  Re: Hirdetes

IrOn @ Új hirdetés tiltó

Szerző:  alfanero [ 2013.05.14. 22:01 ]
Hozzászólás témája:  Re: Hirdetes

SMA Forráskód: [ Mindet kijelol ]
  1. #define PLUGINNAME "No IP hirdetes"
  2. #define VERSION "2.0"
  3. #define AUTHOR "Alfaaaa, JGHG"
  4. /*
  5.  
  6.  
  7. Don't say IPs
  8. =============
  9. Ez a plugin arra jo hogy ha valaki beir egy ip-t akkor mast ir ki helyette vagy bannolja az illetot!
  10. pl. 87.229.100.20:27000 helyett Ez a szerver Kiraly!
  11.  
  12. CVAR:
  13. ip_banviolators -> Bannoljon E Ha Valaki Reklamoz -> (ip_banviolators 1)
  14. ip_banminutes -> Bannolasi Ido -> (pl. ip_banminutes 5)
  15.  
  16.  
  17.  
  18. VERSIONS
  19. ========
  20. 050204 1.0 Hungary Version
  21.  
  22.  
  23. CREDITS
  24. =======
  25. */
  26.  
  27. #include <amxmodx>
  28. #include <regex>
  29.  
  30. #define PATTERN "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b
  31. #define REASON "IP advertising"
  32. #define CVAR_BANMINUTES "ip_banminutes"
  33. #define CVAR_BANVIOLATORS "ip_banviolators"
  34.  
  35. // Globals below
  36. new Regex:g_result
  37. new g_returnvalue
  38. new g_error[64]
  39. new g_allArgs[1024]
  40. // Globals above
  41.  
  42. public plugin_modules() {
  43. require_module("regex")
  44. }
  45.  
  46. public hook_say(id, level, cid) {
  47. read_args(g_allArgs, 1023)
  48. g_result = regex_match(g_allArgs, PATTERN, g_returnvalue, g_error, 63)
  49. switch (g_result) {
  50. case REGEX_MATCH_FAIL: {
  51. log_amx("REGEX_MATCH_FAIL! %s", g_error)
  52. return PLUGIN_CONTINUE
  53. }
  54. case REGEX_PATTERN_FAIL: {
  55. log_amx("REGEX_PATTERN_FAIL! %s", g_error)
  56. return PLUGIN_CONTINUE
  57. }
  58. case REGEX_NO_MATCH: {
  59. return PLUGIN_CONTINUE
  60. }
  61. default: {
  62. if (get_cvar_num(CVAR_BANVIOLATORS)) {
  63. new userid = get_user_userid(id)
  64. new minutesString[10]
  65. get_cvar_string(CVAR_BANMINUTES, minutesString, 9)
  66. new temp[64], banned[16], minutes = get_cvar_num(CVAR_BANMINUTES)
  67.  
  68. if (minutes)
  69. format(temp, 63, "%L", id, "FOR_MIN", minutesString)
  70. else
  71. format(temp, 63, "%L", id, "PERM")
  72.  
  73. format(banned, 15, "%L", id, "BANNED")
  74.  
  75. new authid[32]
  76. get_user_authid(id, authid, 31)
  77.  
  78. new name[32]
  79. get_user_name(id, name, 31)
  80. log_amx("%s (%s), %s %s because of advertising an IP address. This was written: ^"%s^"", name, authid, banned, temp, g_allArgs)
  81.  
  82. server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%d^" ^"%s^";wait;writeid", userid, REASON, banned, temp, minutes, authid)
  83. }
  84. else {
  85. client_cmd(id, "say ^"Ez a Szerver Nagyon Meno!^"")
  86. }
  87. regex_free(g_result)
  88. return PLUGIN_HANDLED // block msg
  89. }
  90. }
  91.  
  92. return PLUGIN_CONTINUE
  93. }
  94.  
  95.  
  96.  
  97. public plugin_init() {
  98. register_plugin(PLUGINNAME, VERSION, AUTHOR)
  99.  
  100. register_clcmd("say", "hook_say")
  101. register_cvar(CVAR_BANVIOLATORS, "0")
  102. register_cvar(CVAR_BANMINUTES, "5")
  103.  
  104. register_dictionary("admincmd.txt")
  105. }

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