hlmod.hu
https://hlmod.hu/

Advanced bann![KÉRÉS]
https://hlmod.hu/viewtopic.php?f=9&t=14798
Oldal: 1 / 1

Szerző:  JoYika [ 2014.03.04. 20:33 ]
Hozzászólás témája:  Advanced bann![KÉRÉS]

Sziasztok!
Szeretnék egy advanced bann plugint kérni ...
Azzal különbözzön a többitől,hogy az adminok szavazást indíthatnak arról,hogy kit bannoljonak.
Lehetőleg működőt.
Ha ez nem megvalósítható akkor egy egyszerű advanced bann plugin is jó amely képet készít és MŰKÖDIK!!!!
Lehetőleg leírást,hogyan tegyem be mert az eddigi leírások hulladékok vagy csak én vagyok hülye xd
Mivel találtam egyet-kettőt itt a fórumon is de... megcsináltam mindent amit kellett mégse bannol ki senkit. Azaz kibassza és egyből vissza jöhet. ELSŐ HELYEN VAN PLUGINS.INI-ben!!!!
Minden bevan téve ahogy kell :)

Szerző:  pixxa112 [ 2014.03.04. 21:00 ]
Hozzászólás témája:  Re: Advanced bann![KÉRÉS]

JoYika írta:
Sziasztok!
Szeretnék egy advanced bann plugint kérni ...
Azzal különbözzön a többitől,hogy az adminok szavazást indíthatnak arról,hogy kit bannoljonak.
Lehetőleg működőt.
Ha ez nem megvalósítható akkor egy egyszerű advanced bann plugin is jó amely képet készít és MŰKÖDIK!!!!
Lehetőleg leírást,hogyan tegyem be mert az eddigi leírások hulladékok vagy csak én vagyok hülye xd
Mivel találtam egyet-kettőt itt a fórumon is de... megcsináltam mindent amit kellett mégse bannol ki senkit. Azaz kibassza és egyből vissza jöhet. ELSŐ HELYEN VAN PLUGINS.INI-ben!!!!
Minden bevan téve ahogy kell :)


Tessék ez képet csinál a bannról!

https://forums.alliedmods.net/showthread.php?t=90318

Szerző:  lolka91 [ 2014.03.06. 12:09 ]
Hozzászólás témája:  Re: Advanced bann![KÉRÉS]

Fontos! az amxx fájlt rakjad a plugins.ini leg elejére mert nem fogja be olvasni. és az amxx.cfgbe ird be ezt amx_website "www.facebook.com/AntisocialServers"
persze a saját facebook oldaladdal vagy honlapoddal hogy innen tudjanak unbant kérni, ez nem csinál se képet se szavazást de okot tudsz írni hogy miért banoltad az embert. és ezt konzolba vissza tudja olvasni.
ezt a txt fájlt pedig rakd data/lang mappába. http://www15.zippyshare.com/v/14541819/file.html

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. // Includes
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <geoip>
  6.  
  7. // Defines
  8. #define VERSION "2.6"
  9.  
  10.  
  11. //********** EDIT HERE if you use AMXBANS ***********//
  12. #define AMXBANS 0 // Set this to 1 to enable AmxBans support. (Uses amx_ban <minutes> <userid> [reason])
  13. //***************************************************//
  14.  
  15.  
  16. #define MAX_PLAYERS 33 // Maximum number of players (plus 1)
  17.  
  18. new g_Activity, g_Hostname, g_DelaySS, g_DelayBan, g_SnapShot, g_UnbanURL, g_MsgType, g_SayText
  19. new g_szBanTime[MAX_PLAYERS][8], g_szBanReason[MAX_PLAYERS][32]
  20. new Array:g_bantimes
  21.  
  22. new g_menuPosition[MAX_PLAYERS]
  23. new g_menuPlayers[MAX_PLAYERS][32]
  24. new g_menuPlayersNum[MAX_PLAYERS]
  25. new g_menuOption[MAX_PLAYERS]
  26. new g_menuSettings[MAX_PLAYERS]
  27.  
  28. public plugin_init()
  29. {
  30. /* Register plugin name and author */
  31. register_plugin("AMX SSBan", VERSION, "God@Dorin\Fysiks");
  32.  
  33. /* Register plugin version */
  34. register_cvar("screen_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
  35.  
  36. /* Register language file */
  37. register_dictionary("screen_message.txt") // Language file for snapshot messages
  38. register_dictionary("admincmd.txt") // Language file for amxmodx bans
  39.  
  40. /* Register cvars */
  41. g_Activity = get_cvar_pointer("amx_show_activity")
  42. g_Hostname = get_cvar_pointer("hostname")
  43. g_DelaySS = register_cvar("amx_ssdelay", "1.0") // Delay between snapshots (Def.: 1.0)
  44. g_DelayBan = register_cvar("amx_bandelay", "10.0") // Delay before ban is done (Def.: 10.0)
  45. g_SnapShot = register_cvar("amx_ssnumber", "3") // Number of snapshots to take (Def.: 3)
  46. g_UnbanURL = register_cvar("amx_website", "www.yoursite.com") // Unban request site (Def.: "www.yoursite.com")
  47. g_MsgType = register_cvar("amx_msg_type", "3") // 1- chat | 2- hud | 3- chat+hud (Def.: 3)
  48.  
  49. /* Register console admin commands */
  50. register_concmd("amx_ss", "cmdSS",ADMIN_KICK, "<name or #userid> - Make snapshots on user !")
  51. #if AMXBANS
  52. if( get_cvar_num("amxbans_use_newbancmd") )
  53. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - - Ban with snapshots! (AmxBans)")
  54. else
  55. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<minutes> <name or #userid> [reason] - Ban with snapshots! (AmxBans)")
  56. #else
  57. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - Ban with snapshots! (AMX Mod X)")
  58. #endif
  59. register_clcmd("_BanReason", "cmdBanReason")
  60.  
  61. g_SayText = get_user_msgid("SayText")
  62.  
  63. /* Register the menu for banning */
  64. register_clcmd("amx_ssmenu", "cmdSSMenu", ADMIN_KICK, " - Displays ScreenShot Menu")
  65. register_clcmd("amx_ssbanmenu", "cmdBanMenu", ADMIN_BAN, " - Displays ScreenShot Ban Menu")
  66. register_menucmd(register_menuid("SS Menu"), 1023, "actionMenu")
  67.  
  68. /* Set bantimes for the menu */
  69. g_bantimes = ArrayCreate()
  70.  
  71. ArrayPushCell(g_bantimes, 0)
  72. ArrayPushCell(g_bantimes, 5)
  73. ArrayPushCell(g_bantimes, 10)
  74. ArrayPushCell(g_bantimes, 30)
  75. ArrayPushCell(g_bantimes, 60)
  76. ArrayPushCell(g_bantimes, 240)
  77. ArrayPushCell(g_bantimes, 1440)
  78.  
  79. register_srvcmd("amx_ssbantimes", "ssbanmenu_setbantimes")
  80. }
  81.  
  82. public cmdSS(id,level,cid)
  83. {
  84. if(!cmd_access(id, level, cid, 1))
  85. return PLUGIN_HANDLED
  86.  
  87. new target[32]
  88. read_argv(1, target, 31)
  89. new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)
  90.  
  91. if(!player)
  92. return PLUGIN_HANDLED
  93.  
  94. new name[32], name2[32]
  95. get_user_name(id, name, 31)
  96. get_user_name(player, name2, 31)
  97. /* show message in chat to all players by amx_show_activity */
  98. switch( get_pcvar_num(g_Activity) )
  99. {
  100. case 2: client_printc(0,"%L", LANG_PLAYER, "SS_CASE2", name, name2)
  101. case 1: client_printc(0,"%L", LANG_PLAYER, "SS_CASE1", name2)
  102. }
  103.  
  104. new Param[2]
  105. Param[0] = id
  106. Param[1] = player
  107. /* Set the task to take snapshots */
  108. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  109. return PLUGIN_HANDLED
  110.  
  111. }
  112.  
  113. public cmdBanSS(id,level,cid)
  114. {
  115. if(!cmd_access(id, level, cid, 3))
  116. return PLUGIN_HANDLED
  117.  
  118. new target[32]
  119.  
  120. #if AMXBANS
  121. if( get_cvar_num("amxbans_use_newbancmd") )
  122. {
  123. read_argv(1, target, 31)
  124. read_argv(2, g_szBanTime[id], 7)
  125. }
  126. else
  127. {
  128. read_argv(1, g_szBanTime[id], 7)
  129. read_argv(2, target, 31)
  130. }
  131. #else
  132. read_argv(1, target, 31)
  133. read_argv(2, g_szBanTime[id], 7)
  134. #endif
  135. read_argv(3, g_szBanReason[id], 63)
  136.  
  137. new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)
  138.  
  139. if(!player)
  140. return PLUGIN_HANDLED
  141.  
  142. new Param[2]
  143. Param[0] = id
  144. Param[1] = player
  145.  
  146. /* Set tasks to take snapshots and ban target */
  147. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  148. set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2)
  149.  
  150. return PLUGIN_HANDLED
  151. }
  152.  
  153. public SS_Task(Param[2])
  154. {
  155. new player = Param[1]
  156. new id = Param[0]
  157. new name[32], timer[32], hostname[64], name2[32], ip[32], authid2[32], country[33], site[64]
  158.  
  159. get_user_name(id, name, 31)
  160. get_user_name(player, name2, 31)
  161. get_user_authid(player, authid2, 31)
  162. get_user_ip(player, ip, 31, 1)
  163.  
  164. geoip_country(ip, country)
  165. get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
  166. get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
  167. get_pcvar_string(g_UnbanURL, site, charsmax(site))
  168.  
  169. switch( get_pcvar_num(g_MsgType) )
  170. {
  171. case 1:
  172. {
  173. /* Show screen messages in chat */
  174. client_printc(player,"%L", player, "SS_MSG1", name)
  175. client_printc(player,"%L", player, "SS_MSG2", timer, hostname)
  176. client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country)
  177. client_printc(player,"%L", player, "SS_MSG4", site)
  178. }
  179. case 2:
  180. {
  181. /* Show screen messages in hud */
  182. set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
  183. show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
  184. }
  185. case 3:
  186. {
  187. /* Show screen messages in chat */
  188. client_printc(player,"%L", player, "SS_MSG1", name)
  189. client_printc(player,"%L", player, "SS_MSG2", timer, hostname)
  190. client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country)
  191. client_printc(player,"%L", player, "SS_MSG4", site)
  192.  
  193. /* Show screen messages in hud */
  194. set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
  195. show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
  196. }
  197. }
  198. /* Take the snapshots ! */
  199. client_cmd(player,"snapshot")
  200. /* Confirm for the admin in console that the command was commited */
  201. console_print(id,"%L", id, "SS_CONSOLE", name2)
  202.  
  203. return PLUGIN_HANDLED
  204. }
  205.  
  206. public BanSS_Task(Param[])
  207. {
  208. new id = Param[0]
  209. new player = Param[1]
  210. new minutes[8], reason[32]
  211. new userid2 = get_user_userid(player)
  212.  
  213. copy(minutes, 7, g_szBanTime[id])
  214. copy(reason, 31, g_szBanReason[id])
  215.  
  216. #if AMXBANS // Ban "player" using AmxBans
  217. if( get_cvar_num("amxbans_use_newbancmd") )
  218. client_cmd(id, "amx_ban #%d %s ^"%s^"", userid2, minutes, reason)
  219. else
  220. client_cmd(id, "amx_ban %s #%d ^"%s^"", minutes, userid2, reason)
  221. #else
  222. // Ban "player" using HL Ban Method
  223.  
  224. new authid[32], name2[32], authid2[32], name[32]
  225.  
  226. get_user_authid(player, authid2, 31)
  227. get_user_authid(id, authid, 31)
  228. get_user_name(player, name2, 31)
  229. get_user_name(id, name, 31)
  230.  
  231. log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)
  232.  
  233. new temp[64], banned[16], nNum = str_to_num(minutes)
  234. if(nNum)
  235. {
  236. formatex(temp, 63, "%L", player, "FOR_MIN", minutes)
  237. }
  238. else
  239. {
  240. formatex(temp, 63, "%L", player, "PERM")
  241. }
  242.  
  243. formatex(banned, 15, "%L", player, "BANNED")
  244.  
  245. if (reason[0])
  246. server_cmd("kick #%d ^"%s (%s %s)^"", userid2, reason, banned, temp)
  247. else
  248. server_cmd("kick #%d ^"%s %s^"", userid2, banned, temp)
  249.  
  250. server_cmd("banid %s %s", minutes, authid2)
  251. server_cmd("writeid")
  252.  
  253. // Display the message to all clients
  254. new msg[256]
  255. new len
  256. new maxpl = get_maxplayers()
  257. for(new i = 1; i <= maxpl; i++)
  258. {
  259. if(is_user_connected(i) && !is_user_bot(i))
  260. {
  261. len = formatex(msg, charsmax(msg), "%L", i, "BAN")
  262. len += formatex(msg[len], charsmax(msg) - len, " %s ", name2)
  263. if(nNum)
  264. {
  265. len += formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes)
  266. }
  267. else
  268. {
  269. len += formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM")
  270. }
  271. if(strlen(reason) > 0)
  272. {
  273. formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason)
  274. }
  275. show_activity_id(i, id, name, msg)
  276. }
  277. }
  278. console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)
  279. #endif
  280. return PLUGIN_HANDLED
  281. }
  282.  
  283. public cmdBanMenu(id, level, cid)
  284. {
  285. if (!cmd_access(id, level, cid, 1))
  286. return PLUGIN_HANDLED
  287.  
  288. g_menuOption[id] = 0
  289.  
  290. if (ArraySize(g_bantimes) > 0)
  291. {
  292. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id])
  293. }
  294. else
  295. {
  296. // should never happen, but failsafe
  297. g_menuSettings[id] = 0
  298. }
  299. displayMenu(id, g_menuPosition[id] = 0)
  300.  
  301. return PLUGIN_HANDLED
  302. }
  303.  
  304. public cmdSSMenu(id, level, cid)
  305. {
  306. if (!cmd_access(id, level, cid, 1))
  307. return PLUGIN_HANDLED
  308.  
  309. g_menuOption[id] = 0
  310.  
  311. g_menuSettings[id] = -1
  312. displayMenu(id, g_menuPosition[id] = 0)
  313.  
  314. return PLUGIN_HANDLED
  315. }
  316.  
  317. displayMenu(id, pos)
  318. {
  319. if (pos < 0)
  320. return
  321.  
  322. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  323.  
  324. new menuBody[512]
  325. new b = 0
  326. new i
  327. new name[32]
  328. new start = pos * 7, len
  329.  
  330. if (start >= g_menuPlayersNum[id])
  331. start = pos = g_menuPosition[id] = 0
  332.  
  333. len = format(menuBody, 511, "\y%L\R%d/%d^n\w^n", id, g_menuSettings[id] == -1 ? "SS_MENU" : "SSBAN_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
  334.  
  335. new end = start + 7
  336. new keys = MENU_KEY_0
  337.  
  338. if (end > g_menuPlayersNum[id])
  339. end = g_menuPlayersNum[id]
  340.  
  341. for (new a = start; a < end; ++a)
  342. {
  343. i = g_menuPlayers[id][a]
  344. get_user_name(i, name, 31)
  345.  
  346. if (is_user_bot(i) || (access(i, ADMIN_IMMUNITY) && i != id))
  347. {
  348. ++b
  349.  
  350. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  351. } else {
  352. keys |= (1<<b)
  353.  
  354. if (is_user_admin(i))
  355. len += format(menuBody[len], 511-len, "%d. %s \r*^n\w", ++b, name)
  356. else
  357. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  358. }
  359. }
  360.  
  361. if(g_menuSettings[id] != -1)
  362. {
  363. if (g_menuSettings[id])
  364. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_FOR_MIN", g_menuSettings[id])
  365. else
  366. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_PERM")
  367. keys |= MENU_KEY_8
  368. }
  369.  
  370. if (end != g_menuPlayersNum[id])
  371. {
  372. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  373. keys |= MENU_KEY_9
  374. }
  375. else
  376. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  377.  
  378. show_menu(id, keys, menuBody, -1, "SS Menu")
  379. }
  380.  
  381. public actionMenu(id, key)
  382. {
  383. switch (key)
  384. {
  385. case 7:
  386. {
  387. ++g_menuOption[id]
  388. g_menuOption[id] %= ArraySize(g_bantimes)
  389.  
  390. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id])
  391.  
  392. displayMenu(id, g_menuPosition[id])
  393. }
  394. case 8: displayMenu(id, ++g_menuPosition[id])
  395. case 9: displayMenu(id, --g_menuPosition[id])
  396. default:
  397. {
  398. new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  399.  
  400. new minutes[8]
  401. num_to_str(g_menuSettings[id], minutes, 7)
  402.  
  403. copy(g_szBanTime[id], 7, minutes)
  404. copy(g_szBanReason[id], 31, "_BanReason")
  405.  
  406. new Param[2]
  407. Param[0] = id
  408. Param[1] = player
  409.  
  410. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  411. if(g_menuSettings[id] != -1)
  412. {
  413. messagemode_reason(id)
  414. set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2)
  415. }
  416.  
  417. // displayMenu(id, g_menuPosition[id]) // Uncomment this line to make menu remain open after banning
  418. }
  419. }
  420.  
  421. return PLUGIN_HANDLED
  422. }
  423.  
  424. messagemode_reason(id)
  425. {
  426. formatex(g_szBanReason[id], charsmax(g_szBanReason[]), "%L", id, "NO_REASON_MENU")
  427.  
  428. new name[32]
  429. get_user_name(id, name, 31)
  430.  
  431. set_hudmessage(255, 0, 0, 0.0, 0.24, 1, 6.0, 12.0)
  432. show_hudmessage(id, "%L", id, "REASON_HUDASK", name)
  433.  
  434. client_cmd(id, "messagemode _BanReason")
  435. }
  436.  
  437. public cmdBanReason(id)
  438. {
  439. // Client has submitted reason.
  440. new szArg[sizeof(g_szBanReason[])]
  441. read_args(szArg, charsmax(szArg))
  442. remove_quotes(szArg)
  443.  
  444. if(szArg[0])
  445. {
  446. formatex(g_szBanReason[id], charsmax(g_szBanReason[]), szArg)
  447. }
  448. return PLUGIN_HANDLED
  449. }
  450.  
  451. public ssbanmenu_setbantimes()
  452. {
  453. new buff[32]
  454. new args = read_argc()
  455.  
  456. if (args <= 1)
  457. {
  458. server_print("usage: amx_ssbantimes <time1> [time2] [time3] ...")
  459. server_print(" use time of 0 for permanent.")
  460.  
  461. return
  462. }
  463.  
  464. ArrayClear(g_bantimes)
  465.  
  466. for (new i = 1; i < args; i++)
  467. {
  468. read_argv(i, buff, charsmax(buff))
  469.  
  470. ArrayPushCell(g_bantimes, str_to_num(buff))
  471.  
  472. }
  473.  
  474. }
  475.  
  476. /* Stock colors for chat messages */
  477. stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {
  478.  
  479. new msg[191], players[32], count = 1
  480. vformat(msg, sizeof msg - 1, string, 3)
  481.  
  482. replace_all(msg,190,"!g","^4")
  483. replace_all(msg,190,"!y","^1")
  484. replace_all(msg,190,"!t","^3")
  485.  
  486. if(id)
  487. players[0] = id
  488. else
  489. get_players(players,count,"ch")
  490.  
  491. for (new i = 0 ; i < count ; i++)
  492. {
  493. if (is_user_connected(players[i]))
  494. {
  495. message_begin(MSG_ONE_UNRELIABLE, g_SayText,_, players[i])
  496. write_byte(players[i])
  497. write_string(msg)
  498. message_end()
  499. }
  500. }
  501. }
  502. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  503. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
  504. */
  505.  

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