hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.11. 19:35



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: amx_ssban HUD ra
HozzászólásElküldve: 2013.03.02. 17:03 
Offline
Tud valamit
Avatar

Csatlakozott: 2013.01.21. 17:29
Hozzászólások: 101
Megköszönt másnak: 32 alkalommal
Megköszönték neki: 2 alkalommal
Sziasztok bele tenne valaki egy HUD üzenetet úgy hogy : amikor egy admin bannol valakit akkor HUD on radar alá írja ki ezt:
Admin: "admin neve"
"bannolt neve" Bannolva: "mennyi időre"
Ok: "ok"
Lehetőleg zölden írja ki radar alatt és így ahogy írtam :D. Jutalom egy köszönet :D . Ha kell akkor 2 :roll:
SMA Forráskód: [ Mindet kijelol ]
  1. /***************************************************************************************************
  2. * Copyleft (c)2010 Teascu Dorin & Fysiks
  3. * Plugin Support:
  4. * or
  5. ****************************************************************************************************
  6. * This program is free software; you can redistribute it and/or modify it under the terms
  7. * of the GNU General Public License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  11. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. * See the GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with this program;
  15. * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  16. * MA 02111-1307 USA
  17. *
  18. * In addition, as a special exception, the author gives permission to link the code of this
  19. * program with the Half-Life Game Engine ("HL Engine") and Modified Game Libraries ("MODs")
  20. * developed by Valve, L.L.C ("Valve"). You must obey the GNU General Public License in all
  21. * respects for all of the code used other than the HL Engine and MODs from Valve.
  22. * If you modify this file, you may extend this exception to your version of the file,
  23. * but you are not obligated to do so. If you do not wish to do so, delete this exception
  24. * statement from your version.
  25. ****************************************************************************************************
  26. * Amx SSBan
  27. * =========
  28. ****************************************************************************************************
  29. * Description
  30. * -----------
  31. * - Take snapshots and ban a player (saved on targets PC) or just take snapshots
  32. ****************************************************************************************************
  33. * Available CVAR's
  34. * ----------------
  35. * amx_ssdelay "1.0" - Delay between snapshots (Def.: "1.0") WARNING has to be .0 as is float
  36. * amx_bandelay "10.0" - Delay before ban is done (Def.: "10.0") WARNING has to be .0 as is float
  37. * amx_ssnumber "3" - Number of snapshots to take (Def.: "3")
  38. * amx_website "" - Unban request site (Def.: "www.yoursite.com")
  39. * amx_msg_type "3" - Info player/admin messages 1 - chat | 2- hud | 3- chat+hud (Def.: "3")
  40. ****************************************************************************************************
  41. * Admin Commands
  42. * --------------
  43. * amx_ss <name or #userid> - Make Snapshots on target !
  44. * amx_ssban <name or #userid> <minutes> [reason] - Ban with snapshots (AMXMODX) !
  45. * If #define AMXBANS is setted to 1 the following console command will be used:
  46. * amx_ssban <minutes> <name or #userid> [reason] - Ban with snapshots (AMXBANS) !
  47. * amx_ssmenu - Displays Snapshot Menu
  48. * amx_ssbanmenu - Displays ban menu
  49. ****************************************************************************************************
  50. * Credits
  51. * -------
  52. * Fysiks - ADDED BAN, SS & SSBan MENU and support for AmxBans v6.x - !!! Thank you !!!
  53. * Alka - stock color chat print
  54. * hackandmore - used his plugin to learn how to use amx_msg_type cvar
  55. * AMXX Dev Team for using their amxmodx ban script
  56. * uTg | bigpapajiggs using his plugin (Admin Screen 2) to learn how to use delay and tasks
  57. * Any other plugins authors that made this type of plugin
  58. ****************************************************************************************************
  59. * Changelog
  60. * ---------
  61. *
  62. * 10.Jul.2010 - v2.6 - [ADDED] support for AmxBans v6.x (by Fysiks)
  63. * [FIXED] lang file by saving it as Unicode without BOM
  64. * 20.Aug.2009 - v2.5 - [ADDED] HUD flashing message to ask reason submission from admin
  65. * 17.Aug.2009 - v2.4 - [FIXED] Amx Mod X banning issue
  66. * 31.Jul.2009 - v2.3 - [ADDED] reason submission for menu bans
  67. * 26.Jul.2009 - v2.2 - [ADDED] menu for taking snapshots - by Fysiks
  68. * [CHANGED] the plugin name from AMXX SSBan w/ Menu in simple AMX SSBan
  69. * 24.Jul.2009 - v2.1 - [REMOVED] amx_ban_type cvar
  70. * [CHANGED] the script for easy usage of bantype (optimized by Fysiks)
  71. * 23.Jul.2009 - v2.0 - [ADDED] ban menu - Al the work provided by Fysiks
  72. * 11.May.2009 - v1.9.5 - [ADDED] tasks controlled by cvar for bans
  73. * [ADDED] cvar amx_bandelay - Delay before ban is done (Def.: 10.0)
  74. * 07.May.2009 - v1.9.1 - [FIXED] the usage of command on immunity admins.
  75. * You can take snapshots of admins with immunity
  76. * 06.May.2009 - v1.9 - [ADDED] to AMXX Snapshot a task to take the snapshots with time delay
  77. * [ADDED] cvar amx_ssdelay - Delay between snapshots (Def.: 1)
  78. * [ADDED] cvar amx_ssnumber - Number of snapshots to take (Def.: 3)
  79. * [ADDED] possibility of taking snapshots on immunity admins
  80. * 06.May.2009 - v1.8.1 beta - [REMOVED] NO ACCESS console message as Fysiks said that
  81. * 'if(!cmd_access...' already does this
  82. * 06.May.2009 - v1.8 beta - [CLEANED] up the plugin (some script arranging)
  83. * [REMOVED] amx_chattag - it was irelevant... left [AMXX] by default as tag
  84. * [ADDED] bans by AMXMODX - THX AMXX Dev Team for ban code
  85. * [ADDED] cvar amx_ban_type - 0- Disabled | 1- AmxModX Ban | 2- AmaBans Ban
  86. * [ADDED] possibility of taking snapshots and banning admins with immunity
  87. * (not working for AMXBANS as is used by server_cmd)
  88. * [ADDED] the console print to inform a player/admin about no acces for command
  89. * 03.May.2009 - v1.7 beta - [ADDED] command amx_ssban to use bans by AMXBANS
  90. * 28.Apr.2009 - v1.6 - [CHANGED] from 'if(get_pcvar_num...' to switch Message type with case
  91. * 18.Apr.2009 - v1.5 - [ADDED] cvar amx_msg_type - 1 - chat | 2- hud | 3- chat+hud (Def: "1")
  92. * [ADDED] hud message for player data (controled by cvar)
  93. * [ADDED] Polish translation
  94. * 17.Apr.2009 - v1.4 - [ADDED] to cache SteamID also in the snapshots - THX xPaw
  95. * 17.Apr.2009 - v1.3 - [CHANGED] cvar to pcvar - THX xPaw for pointing that out !
  96. * 17.Apr.2009 - v1.2 - [ADDED] cvar amx_chattag - Make any tag you like in chat
  97. * 16.Apr.2009 - v1.1 - [ADDED] Multilingual
  98. * 15.Apr.2009 - v1.0:- Initial release
  99. ***************************************************************************************************/
  100.  
  101. // Includes
  102. #include <amxmodx>
  103. #include <amxmisc>
  104. #include <geoip>
  105.  
  106. // Defines
  107. #define VERSION "2.6"
  108.  
  109.  
  110. //********** EDIT HERE if you use AMXBANS ***********//
  111. #define AMXBANS 0 // Set this to 1 to enable AmxBans support. (Uses amx_ban <minutes> <userid> [reason])
  112. //***************************************************//
  113.  
  114.  
  115. #define MAX_PLAYERS 33 // Maximum number of players (plus 1)
  116.  
  117. new g_Activity, g_Hostname, g_DelaySS, g_DelayBan, g_SnapShot, g_UnbanURL, g_MsgType, g_SayText
  118. new g_szBanTime[MAX_PLAYERS][8], g_szBanReason[MAX_PLAYERS][32]
  119. new Array:g_bantimes
  120.  
  121. new g_menuPosition[MAX_PLAYERS]
  122. new g_menuPlayers[MAX_PLAYERS][32]
  123. new g_menuPlayersNum[MAX_PLAYERS]
  124. new g_menuOption[MAX_PLAYERS]
  125. new g_menuSettings[MAX_PLAYERS]
  126.  
  127. public plugin_init()
  128. {
  129. /* Register plugin name and author */
  130. register_plugin("AMX SSBan", VERSION, "God@Dorin\Fysiks");
  131.  
  132. /* Register plugin version */
  133. register_cvar("screen_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
  134.  
  135. /* Register language file */
  136. register_dictionary("screen_message.txt") // Language file for snapshot messages
  137. register_dictionary("admincmd.txt") // Language file for amxmodx bans
  138.  
  139. /* Register cvars */
  140. g_Activity = get_cvar_pointer("amx_show_activity")
  141. g_Hostname = get_cvar_pointer("hostname")
  142. g_DelaySS = register_cvar("amx_ssdelay", "1.0") // Delay between snapshots (Def.: 1.0)
  143. g_DelayBan = register_cvar("amx_bandelay", "10.0") // Delay before ban is done (Def.: 10.0)
  144. g_SnapShot = register_cvar("amx_ssnumber", "3") // Number of snapshots to take (Def.: 3)
  145. g_UnbanURL = register_cvar("amx_website", "www.yoursite.com") // Unban request site (Def.: "www.yoursite.com")
  146. g_MsgType = register_cvar("amx_msg_type", "3") // 1- chat | 2- hud | 3- chat+hud (Def.: 3)
  147.  
  148. /* Register console admin commands */
  149. register_concmd("amx_ss", "cmdSS",ADMIN_KICK, "<name or #userid> - Make snapshots on user !")
  150. #if AMXBANS
  151. if( get_cvar_num("amxbans_use_newbancmd") )
  152. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - - Ban with snapshots! (AmxBans)")
  153. else
  154. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<minutes> <name or #userid> [reason] - Ban with snapshots! (AmxBans)")
  155. #else
  156. register_concmd("amx_ssban", "cmdBanSS", ADMIN_BAN, "<name or #userid> <minutes> [reason] - Ban with snapshots! (AMX Mod X)")
  157. #endif
  158. register_clcmd("_BanReason", "cmdBanReason")
  159.  
  160. g_SayText = get_user_msgid("SayText")
  161.  
  162. /* Register the menu for banning */
  163. register_clcmd("amx_ssmenu", "cmdSSMenu", ADMIN_KICK, " - Displays ScreenShot Menu")
  164. register_clcmd("amx_ssbanmenu", "cmdBanMenu", ADMIN_BAN, " - Displays ScreenShot Ban Menu")
  165. register_menucmd(register_menuid("SS Menu"), 1023, "actionMenu")
  166.  
  167. /* Set bantimes for the menu */
  168. g_bantimes = ArrayCreate()
  169.  
  170. ArrayPushCell(g_bantimes, 0)
  171. ArrayPushCell(g_bantimes, 5)
  172. ArrayPushCell(g_bantimes, 10)
  173. ArrayPushCell(g_bantimes, 30)
  174. ArrayPushCell(g_bantimes, 60)
  175. ArrayPushCell(g_bantimes, 240)
  176. ArrayPushCell(g_bantimes, 1440)
  177.  
  178. register_srvcmd("amx_ssbantimes", "ssbanmenu_setbantimes")
  179. }
  180.  
  181. public cmdSS(id,level,cid)
  182. {
  183. if(!cmd_access(id, level, cid, 1))
  184. return PLUGIN_HANDLED
  185.  
  186. new target[32]
  187. read_argv(1, target, 31)
  188. new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)
  189.  
  190. if(!player)
  191. return PLUGIN_HANDLED
  192.  
  193. new name[32], name2[32]
  194. get_user_name(id, name, 31)
  195. get_user_name(player, name2, 31)
  196. /* show message in chat to all players by amx_show_activity */
  197. switch( get_pcvar_num(g_Activity) )
  198. {
  199. case 2: client_printc(0,"%L", LANG_PLAYER, "SS_CASE2", name, name2)
  200. case 1: client_printc(0,"%L", LANG_PLAYER, "SS_CASE1", name2)
  201. }
  202.  
  203. new Param[2]
  204. Param[0] = id
  205. Param[1] = player
  206. /* Set the task to take snapshots */
  207. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  208. return PLUGIN_HANDLED
  209.  
  210. }
  211.  
  212. public cmdBanSS(id,level,cid)
  213. {
  214. if(!cmd_access(id, level, cid, 3))
  215. return PLUGIN_HANDLED
  216.  
  217. new target[32]
  218.  
  219. #if AMXBANS
  220. if( get_cvar_num("amxbans_use_newbancmd") )
  221. {
  222. read_argv(1, target, 31)
  223. read_argv(2, g_szBanTime[id], 7)
  224. }
  225. else
  226. {
  227. read_argv(1, g_szBanTime[id], 7)
  228. read_argv(2, target, 31)
  229. }
  230. #else
  231. read_argv(1, target, 31)
  232. read_argv(2, g_szBanTime[id], 7)
  233. #endif
  234. read_argv(3, g_szBanReason[id], 63)
  235.  
  236. new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY)
  237.  
  238. if(!player)
  239. return PLUGIN_HANDLED
  240.  
  241. new Param[2]
  242. Param[0] = id
  243. Param[1] = player
  244.  
  245. /* Set tasks to take snapshots and ban target */
  246. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  247. set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2)
  248.  
  249. return PLUGIN_HANDLED
  250. }
  251.  
  252. public SS_Task(Param[2])
  253. {
  254. new player = Param[1]
  255. new id = Param[0]
  256. new name[32], timer[32], hostname[64], name2[32], ip[32], authid2[32], country[33], site[64]
  257.  
  258. get_user_name(id, name, 31)
  259. get_user_name(player, name2, 31)
  260. get_user_authid(player, authid2, 31)
  261. get_user_ip(player, ip, 31, 1)
  262.  
  263. geoip_country(ip, country)
  264. get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
  265. get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
  266. get_pcvar_string(g_UnbanURL, site, charsmax(site))
  267.  
  268. switch( get_pcvar_num(g_MsgType) )
  269. {
  270. case 1:
  271. {
  272. /* Show screen messages in chat */
  273. client_printc(player,"%L", player, "SS_MSG1", name)
  274. client_printc(player,"%L", player, "SS_MSG2", timer, hostname)
  275. client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country)
  276. client_printc(player,"%L", player, "SS_MSG4", site)
  277. }
  278. case 2:
  279. {
  280. /* Show screen messages in hud */
  281. set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
  282. show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
  283. }
  284. case 3:
  285. {
  286. /* Show screen messages in chat */
  287. client_printc(player,"%L", player, "SS_MSG1", name)
  288. client_printc(player,"%L", player, "SS_MSG2", timer, hostname)
  289. client_printc(player,"%L", player, "SS_MSG3", name2, ip, authid2, country)
  290. client_printc(player,"%L", player, "SS_MSG4", site)
  291.  
  292. /* Show screen messages in hud */
  293. set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
  294. show_hudmessage(player, "%L", player, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
  295. }
  296. }
  297. /* Take the snapshots ! */
  298. client_cmd(player,"snapshot")
  299. /* Confirm for the admin in console that the command was commited */
  300. console_print(id,"%L", id, "SS_CONSOLE", name2)
  301.  
  302. return PLUGIN_HANDLED
  303. }
  304.  
  305. public BanSS_Task(Param[])
  306. {
  307. new id = Param[0]
  308. new player = Param[1]
  309. new minutes[8], reason[32]
  310. new userid2 = get_user_userid(player)
  311.  
  312. copy(minutes, 7, g_szBanTime[id])
  313. copy(reason, 31, g_szBanReason[id])
  314.  
  315. #if AMXBANS // Ban "player" using AmxBans
  316. if( get_cvar_num("amxbans_use_newbancmd") )
  317. client_cmd(id, "amx_ban #%d %s ^"%s^"", userid2, minutes, reason)
  318. else
  319. client_cmd(id, "amx_ban %s #%d ^"%s^"", minutes, userid2, reason)
  320. #else
  321. // Ban "player" using HL Ban Method
  322.  
  323. new authid[32], name2[32], authid2[32], name[32]
  324.  
  325. get_user_authid(player, authid2, 31)
  326. get_user_authid(id, authid, 31)
  327. get_user_name(player, name2, 31)
  328. get_user_name(id, name, 31)
  329.  
  330. 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)
  331.  
  332. new temp[64], banned[16], nNum = str_to_num(minutes)
  333. if(nNum)
  334. {
  335. formatex(temp, 63, "%L", player, "FOR_MIN", minutes)
  336. }
  337. else
  338. {
  339. formatex(temp, 63, "%L", player, "PERM")
  340. }
  341.  
  342. formatex(banned, 15, "%L", player, "BANNED")
  343.  
  344. if (reason[0])
  345. server_cmd("kick #%d ^"%s (%s %s)^"", userid2, reason, banned, temp)
  346. else
  347. server_cmd("kick #%d ^"%s %s^"", userid2, banned, temp)
  348.  
  349. server_cmd("banid %s %s", minutes, authid2)
  350. server_cmd("writeid")
  351.  
  352. // Display the message to all clients
  353. new msg[256]
  354. new len
  355. new maxpl = get_maxplayers()
  356. for(new i = 1; i <= maxpl; i++)
  357. {
  358. if(is_user_connected(i) && !is_user_bot(i))
  359. {
  360. len = formatex(msg, charsmax(msg), "%L", i, "BAN")
  361. len += formatex(msg[len], charsmax(msg) - len, " %s ", name2)
  362. if(nNum)
  363. {
  364. len += formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes)
  365. }
  366. else
  367. {
  368. len += formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM")
  369. }
  370. if(strlen(reason) > 0)
  371. {
  372. formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason)
  373. }
  374. show_activity_id(i, id, name, msg)
  375. }
  376. }
  377. console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)
  378. #endif
  379. return PLUGIN_HANDLED
  380. }
  381.  
  382. public cmdBanMenu(id, level, cid)
  383. {
  384. if (!cmd_access(id, level, cid, 1))
  385. return PLUGIN_HANDLED
  386.  
  387. g_menuOption[id] = 0
  388.  
  389. if (ArraySize(g_bantimes) > 0)
  390. {
  391. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id])
  392. }
  393. else
  394. {
  395. // should never happen, but failsafe
  396. g_menuSettings[id] = 0
  397. }
  398. displayMenu(id, g_menuPosition[id] = 0)
  399.  
  400. return PLUGIN_HANDLED
  401. }
  402.  
  403. public cmdSSMenu(id, level, cid)
  404. {
  405. if (!cmd_access(id, level, cid, 1))
  406. return PLUGIN_HANDLED
  407.  
  408. g_menuOption[id] = 0
  409.  
  410. g_menuSettings[id] = -1
  411. displayMenu(id, g_menuPosition[id] = 0)
  412.  
  413. return PLUGIN_HANDLED
  414. }
  415.  
  416. displayMenu(id, pos)
  417. {
  418. if (pos < 0)
  419. return
  420.  
  421. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  422.  
  423. new menuBody[512]
  424. new b = 0
  425. new i
  426. new name[32]
  427. new start = pos * 7, len
  428.  
  429. if (start >= g_menuPlayersNum[id])
  430. start = pos = g_menuPosition[id] = 0
  431.  
  432. 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)))
  433.  
  434. new end = start + 7
  435. new keys = MENU_KEY_0
  436.  
  437. if (end > g_menuPlayersNum[id])
  438. end = g_menuPlayersNum[id]
  439.  
  440. for (new a = start; a < end; ++a)
  441. {
  442. i = g_menuPlayers[id][a]
  443. get_user_name(i, name, 31)
  444.  
  445. if (is_user_bot(i) || (access(i, ADMIN_IMMUNITY) && i != id))
  446. {
  447. ++b
  448.  
  449. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  450. } else {
  451. keys |= (1<<b)
  452.  
  453. if (is_user_admin(i))
  454. len += format(menuBody[len], 511-len, "%d. %s \r*^n\w", ++b, name)
  455. else
  456. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  457. }
  458. }
  459.  
  460. if(g_menuSettings[id] != -1)
  461. {
  462. if (g_menuSettings[id])
  463. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_FOR_MIN", g_menuSettings[id])
  464. else
  465. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_PERM")
  466. keys |= MENU_KEY_8
  467. }
  468.  
  469. if (end != g_menuPlayersNum[id])
  470. {
  471. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  472. keys |= MENU_KEY_9
  473. }
  474. else
  475. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  476.  
  477. show_menu(id, keys, menuBody, -1, "SS Menu")
  478. }
  479.  
  480. public actionMenu(id, key)
  481. {
  482. switch (key)
  483. {
  484. case 7:
  485. {
  486. ++g_menuOption[id]
  487. g_menuOption[id] %= ArraySize(g_bantimes)
  488.  
  489. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id])
  490.  
  491. displayMenu(id, g_menuPosition[id])
  492. }
  493. case 8: displayMenu(id, ++g_menuPosition[id])
  494. case 9: displayMenu(id, --g_menuPosition[id])
  495. default:
  496. {
  497. new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  498.  
  499. new minutes[8]
  500. num_to_str(g_menuSettings[id], minutes, 7)
  501.  
  502. copy(g_szBanTime[id], 7, minutes)
  503. copy(g_szBanReason[id], 31, "_BanReason")
  504.  
  505. new Param[2]
  506. Param[0] = id
  507. Param[1] = player
  508.  
  509. set_task(Float:get_pcvar_float(g_DelaySS), "SS_Task", 0, Param,2, "a", get_pcvar_num(g_SnapShot))
  510. if(g_menuSettings[id] != -1)
  511. {
  512. messagemode_reason(id)
  513. set_task(Float:get_pcvar_float(g_DelayBan), "BanSS_Task", 0, Param, 2)
  514. }
  515.  
  516. // displayMenu(id, g_menuPosition[id]) // Uncomment this line to make menu remain open after banning
  517. }
  518. }
  519.  
  520. return PLUGIN_HANDLED
  521. }
  522.  
  523. messagemode_reason(id)
  524. {
  525. formatex(g_szBanReason[id], charsmax(g_szBanReason[]), "%L", id, "NO_REASON_MENU")
  526.  
  527. new name[32]
  528. get_user_name(id, name, 31)
  529.  
  530. set_hudmessage(255, 0, 0, 0.0, 0.24, 1, 6.0, 12.0)
  531. show_hudmessage(id, "%L", id, "REASON_HUDASK", name)
  532.  
  533. client_cmd(id, "messagemode _BanReason")
  534. }
  535.  
  536. public cmdBanReason(id)
  537. {
  538. // Client has submitted reason.
  539. new szArg[sizeof(g_szBanReason[])]
  540. read_args(szArg, charsmax(szArg))
  541. remove_quotes(szArg)
  542.  
  543. if(szArg[0])
  544. {
  545. formatex(g_szBanReason[id], charsmax(g_szBanReason[]), szArg)
  546. }
  547. return PLUGIN_HANDLED
  548. }
  549.  
  550. public ssbanmenu_setbantimes()
  551. {
  552. new buff[32]
  553. new args = read_argc()
  554.  
  555. if (args <= 1)
  556. {
  557. server_print("usage: amx_ssbantimes <time1> [time2] [time3] ...")
  558. server_print(" use time of 0 for permanent.")
  559.  
  560. return
  561. }
  562.  
  563. ArrayClear(g_bantimes)
  564.  
  565. for (new i = 1; i < args; i++)
  566. {
  567. read_argv(i, buff, charsmax(buff))
  568.  
  569. ArrayPushCell(g_bantimes, str_to_num(buff))
  570.  
  571. }
  572.  
  573. }
  574.  
  575. /* Stock colors for chat messages */
  576. stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {
  577.  
  578. new msg[191], players[32], count = 1
  579. vformat(msg, sizeof msg - 1, string, 3)
  580.  
  581. replace_all(msg,190,"!g","^4")
  582. replace_all(msg,190,"!y","^1")
  583. replace_all(msg,190,"!t","^3")
  584.  
  585. if(id)
  586. players[0] = id
  587. else
  588. get_players(players,count,"ch")
  589.  
  590. for (new i = 0 ; i < count ; i++)
  591. {
  592. if (is_user_connected(players[i]))
  593. {
  594. message_begin(MSG_ONE_UNRELIABLE, g_SayText,_, players[i])
  595. write_byte(players[i])
  596. write_string(msg)
  597. message_end()
  598. }
  599. }
  600. }
  601. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  602. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
  603. */
  604.  

_________________
Kép


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  [ 1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 24 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