hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.29. 12:32



Jelenlévő felhasználók

Jelenleg 346 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 346 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: plmenu.
HozzászólásElküldve: 2015.01.11. 13:56 
Offline
Senior Tag

Csatlakozott: 2013.07.29. 13:15
Hozzászólások: 233
Megköszönt másnak: 125 alkalommal
Sziasztok.
[1.]Abba a plmenube kellene olyat bele írni hogy maximum ne 60 percre lehessen bannolni az amxmenüböl hanem több időre.
enyi időre lehessen bannolni az amxmenüböl:
(fontos hogy ami plmenut megadok abba legyen ez beírva mert ez olyan plmenu ami ha bannolok akkor kéri a ban okot(Advanced plmenu))
2 perc
5 perc
10perc
20 perc
30 perc
60 perc
120 Perc
200 Perc
300 perc
500 perc
1000 perc
1500 perc
2000 perc
2500 perc
3000 perc
3500 perc
4000 perc
[2.] Még úgyan ebben a plmenube belekellene írni azt hogy ha kickelni akarok amxmodmenubol akkor kérje be az okot.
Aki ezeket megcsinálja annak itt és máshol ahol segített másnak ott is nyomok neki egy gombot!

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. /** skip autoloading since it's optional */
  5. #define AMXMODX_NOAUTOLOAD
  6. #include <cstrike>
  7.  
  8. new g_menuPosition[33]
  9. new g_menuPlayers[33][32]
  10. new g_menuPlayersNum[33]
  11. new g_menuOption[33]
  12. new g_menuSettings[33]
  13.  
  14. new g_menuSelect[33][64]
  15. new g_menuSelectNum[33]
  16.  
  17. #define MAX_CLCMDS 24
  18.  
  19. new g_clcmdName[MAX_CLCMDS][32]
  20. new g_clcmdCmd[MAX_CLCMDS][64]
  21. new g_clcmdMisc[MAX_CLCMDS][2]
  22. new g_clcmdNum
  23.  
  24. new g_coloredMenus
  25. new g_cstrike = 0
  26.  
  27. new Array:g_bantimes;
  28. new Array:g_slapsettings;
  29.  
  30. new g_CSTeamNames[3][] = {
  31. "TERRORIST",
  32. "CT",
  33. "SPECTATOR"
  34. }
  35. new g_CSTeamNumbers[3][] = {
  36. "1",
  37. "2",
  38. "6"
  39. }
  40. new g_CSTeamiNumbers[3] = {
  41. 1,
  42. 2,
  43. 6
  44. }
  45.  
  46. new g_ban_player[33];
  47.  
  48.  
  49. public plugin_natives()
  50. {
  51. set_module_filter("module_filter")
  52. set_native_filter("native_filter")
  53. }
  54.  
  55. public plugin_init()
  56. {
  57. register_plugin("Players Menu", AMXX_VERSION_STR, "AMXX Dev Team")
  58. register_dictionary("common.txt")
  59. register_dictionary("admincmd.txt")
  60. register_dictionary("plmenu.txt")
  61.  
  62. register_clcmd("amx_kickmenu", "cmdKickMenu", ADMIN_KICK, "- displays kick menu")
  63. register_clcmd("amx_banmenu", "cmdBanMenu", ADMIN_BAN, "- displays ban menu")
  64. register_clcmd("amx_slapmenu", "cmdSlapMenu", ADMIN_SLAY, "- displays slap/slay menu")
  65. register_clcmd("amx_teammenu", "cmdTeamMenu", ADMIN_LEVEL_A, "- displays team menu")
  66. register_clcmd("amx_clcmdmenu", "cmdClcmdMenu", ADMIN_LEVEL_A, "- displays client cmds menu")
  67. register_clcmd("amx_banreason", "CmdBanReason", ADMIN_BAN, "<reason>");
  68.  
  69. register_menucmd(register_menuid("Ban Menu"), 1023, "actionBanMenu")
  70. register_menucmd(register_menuid("Kick Menu"), 1023, "actionKickMenu")
  71. register_menucmd(register_menuid("Slap/Slay Menu"), 1023, "actionSlapMenu")
  72. register_menucmd(register_menuid("Team Menu"), 1023, "actionTeamMenu")
  73. register_menucmd(register_menuid("Client Cmds Menu"), 1023, "actionClcmdMenu")
  74.  
  75.  
  76. g_bantimes = ArrayCreate();
  77. // Load up the old default values
  78. ArrayPushCell(g_bantimes, 0);
  79. ArrayPushCell(g_bantimes, 5);
  80. ArrayPushCell(g_bantimes, 10);
  81. ArrayPushCell(g_bantimes, 15);
  82. ArrayPushCell(g_bantimes, 30);
  83. ArrayPushCell(g_bantimes, 45);
  84. ArrayPushCell(g_bantimes, 60);
  85.  
  86.  
  87. g_slapsettings = ArrayCreate();
  88. // Old default values
  89. ArrayPushCell(g_slapsettings, 0); // First option is ignored - it is slay
  90. ArrayPushCell(g_slapsettings, 0); // slap 0 damage
  91. ArrayPushCell(g_slapsettings, 1);
  92. ArrayPushCell(g_slapsettings, 5);
  93.  
  94.  
  95. register_srvcmd("amx_plmenu_bantimes", "plmenu_setbantimes");
  96. register_srvcmd("amx_plmenu_slapdmg", "plmenu_setslapdmg");
  97.  
  98. g_coloredMenus = colored_menus()
  99.  
  100. new clcmds_ini_file[64]
  101. get_configsdir(clcmds_ini_file, 63)
  102. format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file)
  103. load_settings(clcmds_ini_file)
  104.  
  105. if (module_exists("cstrike"))
  106. g_cstrike = 1
  107. }
  108. public plmenu_setbantimes()
  109. {
  110. new buff[32];
  111. new args = read_argc();
  112.  
  113. if (args <= 1)
  114. {
  115. server_print("usage: amx_plmenu_bantimes <time1> [time2] [time3] ...");
  116. server_print(" use time of 0 for permanent.");
  117.  
  118. return;
  119. }
  120.  
  121. ArrayClear(g_bantimes);
  122.  
  123. for (new i = 1; i < args; i++)
  124. {
  125. read_argv(i, buff, charsmax(buff));
  126.  
  127. ArrayPushCell(g_bantimes, str_to_num(buff));
  128.  
  129. }
  130.  
  131. }
  132. public plmenu_setslapdmg()
  133. {
  134. new buff[32];
  135. new args = read_argc();
  136.  
  137. if (args <= 1)
  138. {
  139. server_print("usage: amx_plmenu_slapdmg <dmg1> [dmg2] [dmg3] ...");
  140. server_print(" slay is automatically set for the first value.");
  141.  
  142. return;
  143. }
  144.  
  145. ArrayClear(g_slapsettings);
  146.  
  147. ArrayPushCell(g_slapsettings, 0); // compensate for slay
  148.  
  149. for (new i = 1; i < args; i++)
  150. {
  151. read_argv(i, buff, charsmax(buff));
  152.  
  153. ArrayPushCell(g_slapsettings, str_to_num(buff));
  154.  
  155. }
  156.  
  157. }
  158. public module_filter(const module[])
  159. {
  160. if (equali(module, "cstrike"))
  161. return PLUGIN_HANDLED
  162.  
  163. return PLUGIN_CONTINUE
  164. }
  165.  
  166. public native_filter(const name[], index, trap)
  167. {
  168. if (!trap)
  169. return PLUGIN_HANDLED
  170.  
  171. return PLUGIN_CONTINUE
  172. }
  173.  
  174. /* Ban menu */
  175.  
  176. public client_disconnect(id)
  177. {
  178. g_ban_player[id] = 0;
  179. }
  180.  
  181. public CmdBanReason(id)
  182. {
  183. new player = g_ban_player[id];
  184.  
  185. if( !player ) return PLUGIN_HANDLED;
  186.  
  187. new reason[128];
  188. read_args(reason, sizeof(reason) - 1);
  189. remove_quotes(reason);
  190.  
  191. new name[32], name2[32], authid[32], authid2[32]
  192.  
  193. get_user_name(player, name2, 31)
  194. get_user_authid(id, authid, 31)
  195. get_user_authid(player, authid2, 31)
  196. get_user_name(id, name, 31)
  197.  
  198. new userid2 = get_user_userid(player)
  199.  
  200. log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, g_menuSettings[id], reason)
  201.  
  202. if ( !equal("STEAM_0:", authid2, 8))
  203. {
  204. client_cmd(id, "amx_banip #%i %i ^"%s^"", userid2, g_menuSettings[id], reason);
  205. }
  206. else
  207. {
  208. client_cmd(id, "amx_ban #%i %i ^"%s^"", userid2, g_menuSettings[id], reason);
  209. }
  210.  
  211. server_exec()
  212.  
  213. g_ban_player[id] = 0;
  214.  
  215. displayBanMenu(id, g_menuPosition[id])
  216.  
  217. return PLUGIN_HANDLED;
  218. }
  219.  
  220. public actionBanMenu(id, key)
  221. {
  222. switch (key)
  223. {
  224. case 7:
  225. {
  226. /* BEGIN OF CHANGES BY MISTAGEE ADDED A FEW MORE OPTIONS */
  227.  
  228. ++g_menuOption[id]
  229. g_menuOption[id] %= ArraySize(g_bantimes);
  230.  
  231. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]);
  232.  
  233. displayBanMenu(id, g_menuPosition[id])
  234. }
  235. case 8: displayBanMenu(id, ++g_menuPosition[id])
  236. case 9: displayBanMenu(id, --g_menuPosition[id])
  237. default:
  238. {
  239. g_ban_player[id] = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  240.  
  241. client_cmd(id, "messagemode amx_banreason");
  242.  
  243. client_print(id, print_chat, "[AMXX] Type in the reason for banning this player.");
  244.  
  245.  
  246. /*new name[32], name2[32], authid[32], authid2[32]
  247.  
  248. get_user_name(player, name2, 31)
  249. get_user_authid(id, authid, 31)
  250. get_user_authid(player, authid2, 31)
  251. get_user_name(id, name, 31)
  252.  
  253. new userid2 = get_user_userid(player)
  254.  
  255. log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")", name, get_user_userid(id), authid, name2, userid2, authid2, g_menuSettings[id])
  256.  
  257. if (g_menuSettings[id]==0) // permanent
  258. {
  259. new maxpl = get_maxplayers();
  260. for (new i = 1; i <= maxpl; i++)
  261. {
  262. show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM");
  263. }
  264. }
  265. else
  266. {
  267. new tempTime[32];
  268. formatex(tempTime,sizeof(tempTime)-1,"%d",g_menuSettings[id]);
  269. new maxpl = get_maxplayers();
  270. for (new i = 1; i <= maxpl; i++)
  271. {
  272. show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime);
  273. }
  274. }
  275. // ---------- check for Steam ID added by MistaGee --------------------
  276. // IF AUTHID == 4294967295 OR VALVE_ID_LAN OR HLTV, BAN PER IP TO NOT BAN EVERYONE
  277.  
  278. if (equal("4294967295", authid2)
  279. || equal("HLTV", authid2)
  280. || equal("STEAM_ID_LAN", authid2)
  281. || equali("VALVE_ID_LAN", authid2))
  282. {
  283. // END OF MODIFICATIONS BY MISTAGEE
  284. server_cmd("amx_banip #%i %i ^"Banned From Menu^"", userid2, g_menuSettings[id]);
  285. }
  286. else
  287. {
  288. server_cmd("amx_ban #%i %i ^"Banned From Menu^"", userid2, g_menuSettings[id]);
  289. }
  290.  
  291. server_exec()
  292.  
  293. displayBanMenu(id, g_menuPosition[id])*/
  294. }
  295. }
  296.  
  297. return PLUGIN_HANDLED
  298. }
  299.  
  300. displayBanMenu(id, pos)
  301. {
  302. if (pos < 0)
  303. return
  304.  
  305. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  306.  
  307. new menuBody[512]
  308. new b = 0
  309. new i
  310. new name[32]
  311. new start = pos * 7
  312.  
  313. if (start >= g_menuPlayersNum[id])
  314. start = pos = g_menuPosition[id] = 0
  315.  
  316. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "BAN_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
  317. new end = start + 7
  318. new keys = MENU_KEY_0|MENU_KEY_8
  319.  
  320. if (end > g_menuPlayersNum[id])
  321. end = g_menuPlayersNum[id]
  322.  
  323. for (new a = start; a < end; ++a)
  324. {
  325. i = g_menuPlayers[id][a]
  326. get_user_name(i, name, 31)
  327.  
  328. if (is_user_bot(i) || (access(i, ADMIN_IMMUNITY) && i != id))
  329. {
  330. ++b
  331.  
  332. if (g_coloredMenus)
  333. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  334. else
  335. len += format(menuBody[len], 511-len, "#. %s^n", name)
  336. } else {
  337. keys |= (1<<b)
  338.  
  339. if (is_user_admin(i))
  340. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
  341. else
  342. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  343. }
  344. }
  345.  
  346. if (g_menuSettings[id])
  347. {
  348. new banLength[32]
  349. if (timeToString(g_menuSettings[id], banLength, 31))
  350. len += format(menuBody[len], 511-len, "^n8. Ban for %s^n", banLength)
  351. else
  352. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_FOR_MIN", g_menuSettings[id])
  353. }
  354. else
  355. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "BAN_PERM")
  356.  
  357. if (end != g_menuPlayersNum[id])
  358. {
  359. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  360. keys |= MENU_KEY_9
  361. }
  362. else
  363. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  364.  
  365. show_menu(id, keys, menuBody, -1, "Ban Menu")
  366. }
  367.  
  368. timeToString(minutes, output[], len)
  369. {
  370. new hours = minutes / 60;
  371. minutes %= 60;
  372.  
  373. new days = hours / 24;
  374. hours %= 24;
  375.  
  376. new ret
  377.  
  378. if (days)
  379. ret += formatex(output[ret], len-ret, "%s%d day%s", ret ? ", " : "", days, (days == 1) ? "" : "s")
  380.  
  381. if (hours)
  382. ret += formatex(output[ret], len-ret, "%s%d hour%s", ret ? ", " : "", hours, (hours == 1) ? "" : "s")
  383.  
  384. if (minutes)
  385. ret += formatex(output[ret], len-ret, "%s%d minute%s", ret ? ", " : "", minutes, (minutes == 1) ? "" : "s")
  386.  
  387. return ret
  388. }
  389.  
  390. public cmdBanMenu(id, level, cid)
  391. {
  392. if (!cmd_access(id, level, cid, 1))
  393. return PLUGIN_HANDLED
  394.  
  395. g_menuOption[id] = 0
  396.  
  397. if (ArraySize(g_bantimes) > 0)
  398. {
  399. g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]);
  400. }
  401. else
  402. {
  403. // should never happen, but failsafe
  404. g_menuSettings[id] = 0
  405. }
  406. displayBanMenu(id, g_menuPosition[id] = 0)
  407.  
  408. return PLUGIN_HANDLED
  409. }
  410.  
  411. /* Slap/Slay */
  412.  
  413. public actionSlapMenu(id, key)
  414. {
  415. switch (key)
  416. {
  417. case 7:
  418. {
  419. ++g_menuOption[id]
  420.  
  421. g_menuOption[id] %= ArraySize(g_slapsettings);
  422.  
  423. g_menuSettings[id] = ArrayGetCell(g_slapsettings, g_menuOption[id]);
  424.  
  425. displaySlapMenu(id, g_menuPosition[id]);
  426. }
  427. case 8: displaySlapMenu(id, ++g_menuPosition[id])
  428. case 9: displaySlapMenu(id, --g_menuPosition[id])
  429. default:
  430. {
  431. new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  432. new name2[32]
  433.  
  434. get_user_name(player, name2, 31)
  435.  
  436. if (!is_user_alive(player))
  437. {
  438. client_print(id, print_chat, "%L", id, "CANT_PERF_DEAD", name2)
  439. displaySlapMenu(id, g_menuPosition[id])
  440. return PLUGIN_HANDLED
  441. }
  442.  
  443. new authid[32], authid2[32], name[32]
  444.  
  445. get_user_authid(id, authid, 31)
  446. get_user_authid(player, authid2, 31)
  447. get_user_name(id, name, 31)
  448.  
  449. if (g_menuOption[id])
  450. {
  451. log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, g_menuSettings[id], name2, get_user_userid(player), authid2)
  452.  
  453. show_activity_key("ADMIN_SLAP_1", "ADMIN_SLAP_2", name, name2, g_menuSettings[id]);
  454. } else {
  455. log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2)
  456.  
  457. show_activity_key("ADMIN_SLAY_1", "ADMIN_SLAY_2", name, name2);
  458. }
  459.  
  460. if (g_menuOption[id])
  461. user_slap(player, (get_user_health(player) > g_menuSettings[id]) ? g_menuSettings[id] : 0)
  462. else
  463. user_kill(player)
  464.  
  465. displaySlapMenu(id, g_menuPosition[id])
  466. }
  467. }
  468.  
  469. return PLUGIN_HANDLED
  470. }
  471.  
  472. displaySlapMenu(id, pos)
  473. {
  474. if (pos < 0)
  475. return
  476.  
  477. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  478.  
  479. new menuBody[512]
  480. new b = 0
  481. new i
  482. new name[32], team[4]
  483. new start = pos * 7
  484.  
  485. if (start >= g_menuPlayersNum[id])
  486. start = pos = g_menuPosition[id] = 0
  487.  
  488. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "SLAP_SLAY_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
  489. new end = start + 7
  490. new keys = MENU_KEY_0|MENU_KEY_8
  491.  
  492. if (end > g_menuPlayersNum[id])
  493. end = g_menuPlayersNum[id]
  494.  
  495. for (new a = start; a < end; ++a)
  496. {
  497. i = g_menuPlayers[id][a]
  498. get_user_name(i, name, 31)
  499.  
  500. if (g_cstrike)
  501. {
  502. if (cs_get_user_team(i) == CS_TEAM_T)
  503. {
  504. copy(team, 3, "TE")
  505. }
  506. else if (cs_get_user_team(i) == CS_TEAM_CT)
  507. {
  508. copy(team, 3, "CT")
  509. } else {
  510. get_user_team(i, team, 3)
  511. }
  512. } else {
  513. get_user_team(i, team, 3)
  514. }
  515.  
  516. if (!is_user_alive(i) || (access(i, ADMIN_IMMUNITY) && i != id))
  517. {
  518. ++b
  519.  
  520. if (g_coloredMenus)
  521. len += format(menuBody[len], 511-len, "\d%d. %s\R%s^n\w", b, name, team)
  522. else
  523. len += format(menuBody[len], 511-len, "#. %s %s^n", name, team)
  524. } else {
  525. keys |= (1<<b)
  526.  
  527. if (is_user_admin(i))
  528. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*\y\R%s^n\w" : "%d. %s * %s^n", ++b, name, team)
  529. else
  530. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s %s^n", ++b, name, team)
  531. }
  532. }
  533.  
  534. if (g_menuOption[id])
  535. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "SLAP_WITH_DMG", g_menuSettings[id])
  536. else
  537. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "SLAY")
  538.  
  539. if (end != g_menuPlayersNum[id])
  540. {
  541. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  542. keys |= MENU_KEY_9
  543. }
  544. else
  545. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  546.  
  547. show_menu(id, keys, menuBody, -1, "Slap/Slay Menu")
  548. }
  549.  
  550. public cmdSlapMenu(id, level, cid)
  551. {
  552. if (!cmd_access(id, level, cid, 1))
  553. return PLUGIN_HANDLED
  554.  
  555. g_menuOption[id] = 0
  556. if (ArraySize(g_slapsettings) > 0)
  557. {
  558. g_menuSettings[id] = ArrayGetCell(g_slapsettings, g_menuOption[id]);
  559. }
  560. else
  561. {
  562. // should never happen, but failsafe
  563. g_menuSettings[id] = 0
  564. }
  565.  
  566. displaySlapMenu(id, g_menuPosition[id] = 0)
  567.  
  568. return PLUGIN_HANDLED
  569. }
  570.  
  571. /* Kick */
  572.  
  573. public actionKickMenu(id, key)
  574. {
  575. switch (key)
  576. {
  577. case 8: displayKickMenu(id, ++g_menuPosition[id])
  578. case 9: displayKickMenu(id, --g_menuPosition[id])
  579. default:
  580. {
  581. new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
  582. new authid[32], authid2[32], name[32], name2[32]
  583.  
  584. get_user_authid(id, authid, 31)
  585. get_user_authid(player, authid2, 31)
  586. get_user_name(id, name, 31)
  587. get_user_name(player, name2, 31)
  588.  
  589. new userid2 = get_user_userid(player)
  590.  
  591. log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, userid2, authid2)
  592.  
  593. show_activity_key("ADMIN_KICK_1", "ADMIN_KICK_2", name, name2);
  594.  
  595.  
  596. server_cmd("kick #%d", userid2)
  597. server_exec()
  598.  
  599. displayKickMenu(id, g_menuPosition[id])
  600. }
  601. }
  602.  
  603. return PLUGIN_HANDLED
  604. }
  605.  
  606. displayKickMenu(id, pos)
  607. {
  608. if (pos < 0)
  609. return
  610.  
  611. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  612.  
  613. new menuBody[512]
  614. new b = 0
  615. new i
  616. new name[32]
  617. new start = pos * 8
  618.  
  619. if (start >= g_menuPlayersNum[id])
  620. start = pos = g_menuPosition[id] = 0
  621.  
  622. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "KICK_MENU", pos + 1, (g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0)))
  623. new end = start + 8
  624. new keys = MENU_KEY_0
  625.  
  626. if (end > g_menuPlayersNum[id])
  627. end = g_menuPlayersNum[id]
  628.  
  629. for (new a = start; a < end; ++a)
  630. {
  631. i = g_menuPlayers[id][a]
  632. get_user_name(i, name, 31)
  633.  
  634. if (access(i, ADMIN_IMMUNITY) && i != id)
  635. {
  636. ++b
  637.  
  638. if (g_coloredMenus)
  639. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  640. else
  641. len += format(menuBody[len], 511-len, "#. %s^n", name)
  642. } else {
  643. keys |= (1<<b)
  644.  
  645. if (is_user_admin(i))
  646. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
  647. else
  648. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  649. }
  650. }
  651.  
  652. if (end != g_menuPlayersNum[id])
  653. {
  654. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  655. keys |= MENU_KEY_9
  656. }
  657. else
  658. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  659.  
  660. show_menu(id, keys, menuBody, -1, "Kick Menu")
  661. }
  662.  
  663. public cmdKickMenu(id, level, cid)
  664. {
  665. if (cmd_access(id, level, cid, 1))
  666. displayKickMenu(id, g_menuPosition[id] = 0)
  667.  
  668. return PLUGIN_HANDLED
  669. }
  670.  
  671. /* Team menu */
  672.  
  673. public actionTeamMenu(id, key)
  674. {
  675. switch (key)
  676. {
  677. case 7:
  678. {
  679. g_menuOption[id] = (g_menuOption[id] + 1) % (g_cstrike ? 3 : 2);
  680. displayTeamMenu(id, g_menuPosition[id])
  681. }
  682. case 8: displayTeamMenu(id, ++g_menuPosition[id])
  683. case 9: displayTeamMenu(id, --g_menuPosition[id])
  684. default:
  685. {
  686. new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  687. new authid[32], authid2[32], name[32], name2[32]
  688.  
  689. get_user_name(player, name2, 31)
  690. get_user_authid(id, authid, 31)
  691. get_user_authid(player, authid2, 31)
  692. get_user_name(id, name, 31)
  693.  
  694. log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2, g_menuOption[id] ? "TERRORIST" : "CT")
  695.  
  696. show_activity_key("ADMIN_TRANSF_1", "ADMIN_TRANSF_2", name, name2, g_CSTeamNames[g_menuOption[id] % 3]);
  697.  
  698. if (g_cstrike)
  699. {
  700. if (is_user_alive(player))
  701. {
  702. new deaths = cs_get_user_deaths(player)
  703. user_kill(player, 1)
  704. cs_set_user_deaths(player, deaths)
  705. }
  706. // This modulo math just aligns the option to the CsTeams-corresponding number
  707. cs_set_user_team(player, (g_menuOption[id] % 3) + 1)
  708. cs_reset_user_model(player)
  709. } else {
  710. new limit_setting = get_cvar_num("mp_limitteams")
  711.  
  712. set_cvar_num("mp_limitteams", 0)
  713. engclient_cmd(player, "jointeam", g_CSTeamNumbers[g_menuOption[id] % 2])
  714. engclient_cmd(player, "joinclass", "1")
  715. set_cvar_num("mp_limitteams", limit_setting)
  716. }
  717.  
  718. displayTeamMenu(id, g_menuPosition[id])
  719. }
  720. }
  721.  
  722. return PLUGIN_HANDLED
  723. }
  724.  
  725. displayTeamMenu(id, pos)
  726. {
  727. if (pos < 0)
  728. return
  729.  
  730. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  731.  
  732. new menuBody[512]
  733. new b = 0
  734. new i, iteam
  735. new name[32], team[4]
  736. new start = pos * 7
  737.  
  738. if (start >= g_menuPlayersNum[id])
  739. start = pos = g_menuPosition[id] = 0
  740.  
  741. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "TEAM_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
  742. new end = start + 7
  743. new keys = MENU_KEY_0|MENU_KEY_8
  744.  
  745. if (end > g_menuPlayersNum[id])
  746. end = g_menuPlayersNum[id]
  747.  
  748. for (new a = start; a < end; ++a)
  749. {
  750. i = g_menuPlayers[id][a]
  751. get_user_name(i, name, 31)
  752.  
  753. if (g_cstrike)
  754. {
  755. iteam = _:cs_get_user_team(i)
  756.  
  757. if (iteam == 1)
  758. {
  759. copy(team, 3, "TE")
  760. }
  761. else if (iteam == 2)
  762. {
  763. copy(team, 3, "CT")
  764. }
  765. else if (iteam == 3)
  766. {
  767. copy(team, 3, "SPE");
  768. iteam = 6;
  769. } else {
  770. iteam = get_user_team(i, team, 3)
  771. }
  772. } else {
  773. iteam = get_user_team(i, team, 3)
  774. }
  775.  
  776. if ((iteam == g_CSTeamiNumbers[g_menuOption[id] % (g_cstrike ? 3 : 2)]) || (access(i, ADMIN_IMMUNITY) && i != id))
  777. {
  778. ++b
  779.  
  780. if (g_coloredMenus)
  781. len += format(menuBody[len], 511-len, "\d%d. %s\R%s^n\w", b, name, team)
  782. else
  783. len += format(menuBody[len], 511-len, "#. %s %s^n", name, team)
  784. } else {
  785. keys |= (1<<b)
  786.  
  787. if (is_user_admin(i))
  788. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*\y\R%s^n\w" : "%d. %s * %s^n", ++b, name, team)
  789. else
  790. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s %s^n", ++b, name, team)
  791. }
  792. }
  793.  
  794. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "TRANSF_TO", g_CSTeamNames[g_menuOption[id] % (g_cstrike ? 3 : 2)])
  795.  
  796. if (end != g_menuPlayersNum[id])
  797. {
  798. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  799. keys |= MENU_KEY_9
  800. }
  801. else
  802. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  803.  
  804. show_menu(id, keys, menuBody, -1, "Team Menu")
  805. }
  806.  
  807. public cmdTeamMenu(id, level, cid)
  808. {
  809. if (!cmd_access(id, level, cid, 1))
  810. return PLUGIN_HANDLED
  811.  
  812. g_menuOption[id] = 0
  813.  
  814. displayTeamMenu(id, g_menuPosition[id] = 0)
  815.  
  816. return PLUGIN_HANDLED
  817. }
  818.  
  819. /* Client cmds menu */
  820.  
  821. public actionClcmdMenu(id, key)
  822. {
  823. switch (key)
  824. {
  825. case 7:
  826. {
  827. ++g_menuOption[id]
  828. g_menuOption[id] %= g_menuSelectNum[id]
  829. displayClcmdMenu(id, g_menuPosition[id])
  830. }
  831. case 8: displayClcmdMenu(id, ++g_menuPosition[id])
  832. case 9: displayClcmdMenu(id, --g_menuPosition[id])
  833. default:
  834. {
  835. new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
  836. new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
  837.  
  838. if (is_user_connected(player))
  839. {
  840. new command[512], authid[32], name[32], userid[32]
  841.  
  842. copy(command, charsmax(command), g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
  843. get_user_authid(player, authid, 31)
  844. get_user_name(player, name, 31)
  845. num_to_str(get_user_userid(player), userid, 31)
  846.  
  847. replace(command, charsmax(command), "%userid%", userid)
  848. replace(command, charsmax(command), "%authid%", authid)
  849. replace(command, charsmax(command), "%name%", name)
  850.  
  851. if (flags & 1)
  852. {
  853. server_cmd("%s", command)
  854. server_exec()
  855. } else if (flags & 2)
  856. client_cmd(id, "%s", command)
  857. else if (flags & 4)
  858. client_cmd(player, "%s", command)
  859. }
  860.  
  861. if (flags & 8)
  862. displayClcmdMenu(id, g_menuPosition[id])
  863. }
  864. }
  865.  
  866. return PLUGIN_HANDLED
  867. }
  868.  
  869. displayClcmdMenu(id, pos)
  870. {
  871. if (pos < 0)
  872. return
  873.  
  874. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  875.  
  876. new menuBody[512]
  877. new b = 0
  878. new i
  879. new name[32]
  880. new start = pos * 7
  881.  
  882. if (start >= g_menuPlayersNum[id])
  883. start = pos = g_menuPosition[id] = 0
  884.  
  885. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "CL_CMD_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
  886. new end = start + 7
  887. new keys = MENU_KEY_0|MENU_KEY_8
  888.  
  889. if (end > g_menuPlayersNum[id])
  890. end = g_menuPlayersNum[id]
  891.  
  892. for (new a = start; a < end; ++a)
  893. {
  894. i = g_menuPlayers[id][a]
  895. get_user_name(i, name, 31)
  896.  
  897. if (!g_menuSelectNum[id] || (access(i, ADMIN_IMMUNITY) && i != id))
  898. {
  899. ++b
  900.  
  901. if (g_coloredMenus)
  902. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  903. else
  904. len += format(menuBody[len], 511-len, "#. %s^n", name)
  905. } else {
  906. keys |= (1<<b)
  907.  
  908. if (is_user_admin(i))
  909. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
  910. else
  911. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  912. }
  913. }
  914.  
  915. if (g_menuSelectNum[id])
  916. len += format(menuBody[len], 511-len, "^n8. %s^n", g_clcmdName[g_menuSelect[id][g_menuOption[id]]])
  917. else
  918. len += format(menuBody[len], 511-len, "^n8. %L^n", id, "NO_CMDS")
  919.  
  920. if (end != g_menuPlayersNum[id])
  921. {
  922. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  923. keys |= MENU_KEY_9
  924. }
  925. else
  926. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  927.  
  928. show_menu(id, keys, menuBody, -1, "Client Cmds Menu")
  929. }
  930.  
  931. public cmdClcmdMenu(id, level, cid)
  932. {
  933. if (!cmd_access(id, level, cid, 1))
  934. return PLUGIN_HANDLED
  935.  
  936. g_menuSelectNum[id] = 0
  937.  
  938. for (new a = 0; a < g_clcmdNum; ++a)
  939. if (access(id, g_clcmdMisc[a][0]))
  940. g_menuSelect[id][g_menuSelectNum[id]++] = a
  941.  
  942. g_menuOption[id] = 0
  943.  
  944. displayClcmdMenu(id, g_menuPosition[id] = 0)
  945.  
  946. return PLUGIN_HANDLED
  947. }
  948.  
  949. load_settings(szFilename[])
  950. {
  951. if (!file_exists(szFilename))
  952. return 0
  953.  
  954. new text[256], szFlags[32], szAccess[32]
  955. new a, pos = 0
  956.  
  957. while (g_clcmdNum < MAX_CLCMDS && read_file(szFilename, pos++, text, 255, a))
  958. {
  959. if (text[0] == ';') continue
  960.  
  961. if (parse(text, g_clcmdName[g_clcmdNum], 31, g_clcmdCmd[g_clcmdNum], 63, szFlags, 31, szAccess, 31) > 3)
  962. {
  963. while (replace(g_clcmdCmd[g_clcmdNum], 63, "\'", "^""))
  964. {
  965. // do nothing
  966. }
  967.  
  968. g_clcmdMisc[g_clcmdNum][1] = read_flags(szFlags)
  969. g_clcmdMisc[g_clcmdNum][0] = read_flags(szAccess)
  970. g_clcmdNum++
  971. }
  972. }
  973.  
  974. return 1
  975. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: plmenu.
HozzászólásElküldve: 2015.01.11. 14:11 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.04.10. 15:32
Hozzászólások: 776
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 60 alkalommal
amxx.cfg-ben kell át írni

Kód:
// AMX Mod X Configuration File
echo Executing AMX Mod X Configuration File

// Default access for all non admin players (see users.ini for access details)
//
// Default value: "z"
amx_default_access "z"

// Name of setinfo which should store a password on a client (you should change this)
// Note: Always prefix the field with an underscore (aka: "_")
// (Example: setinfo _pw "password")
//
// Default value: "_pw"
amx_password_field "_pw"

// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
//
// Default value: 1
amx_mode 1

// Show admins activity
// 0 - disabled
// 1 - show without admin name
// 2 - show with name
//
// Default value: 2
amx_show_activity 2

// Frequency in seconds and text of scrolling message
//
// Default value: "Welcome to %hostname% -- This server is using AMX Mod X" 600
amx_scrollmsg "Welcome to %hostname% -- This server is using AMX Mod X" 600

// Center typed colored messages (last parameter is a color in RRRGGGBBB format)
//
// Default values: "Welcome to %hostname%" "000255100"
//                 "Cs  1.6 Dubstep_Pr0 version by:qrWa*-*:$" "000100255"
amx_imessage "Welcome to %hostname%" "000255100"
amx_imessage "Cs  1.6 Dubstep_Pr0 version by:qrWa*-*:$" "000100255"

// Frequency in seconds of colored messages
//
// Default value: 180
amx_freq_imessage 180

// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban.
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60

// Slap damage amounts for the main slap menu (amx_slapmenu)
// Slay is automatically inserted as the first option.
// Default values: 0 1 5
amx_plmenu_slapdmg 0 1 5

// Set in seconds how fast players can chat (chat-flood protection)
//
// Default value: 0.75
amx_flood_time 0.75

// Amount of slots to reserve.
//
// Default value: 0
amx_reservation 0

// If you set this to 1, you can hide slots on your server.
// If server "full" of public slots and slots hidden, you must manually connect with connect console command
//
// Default value: 0
amx_hideslots 0

// Displaying of time remaining
// a - display white text on bottom
// b - use voice
// c - don't add "remaining" (only in voice)
// d - don't add "hours/minutes/seconds" (only in voice)
// e - show/speak if current time is less than this set in parameter
//
// Default value: "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"
amx_time_display "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"

// Announce "say thetime" and "say timeleft" with voice, set to 0 to disable.
//
// Default value: 1
amx_time_voice 1

// Minimum delay in seconds between two voting sessions
//
// Default value: 10
amx_vote_delay 10

// How long voting session goes on
//
// Default value: 10
amx_vote_time 10

// Display who votes for what option, set to 0 to disable, 1 to enable.
//
// Default value: 1
amx_vote_answers 1

// Some ratios for voting success

// Default value: 0.40
amx_votekick_ratio 0.40

// Default value: 0.40
amx_voteban_ratio 0.40

// Default value: 0.40
amx_votemap_ratio 0.40

// Default value: 0.02
amx_vote_ratio 0.02

// Max. time to which map can be extended
//
// Default value: 90
amx_extendmap_max 90

// Step for each extending
//
// Default value: 15
amx_extendmap_step 15

// If you set this to 0, clients cannot chose their language, instead they use
// whatever language the server is configured to use.
//
// Default value: 1
amx_client_languages 1

// Plugin Debug mode
// 0 - No debugging (garbage line numbers)
// 1 - Plugins with "debug" option in plugins.ini are put into debug mode
// 2 - All plugins are put in debug mode
// Note - debug mode will affect JIT performance
//
// Default value: 1
amx_debug 1

// Plugin MultiLingual Debug
// To debug a language put its 2 letter code between quotes ("en", "de", etc)
// "" means disabled
//
// Default value: ""
amx_mldebug ""


set_hudmessage(255, 0, 0, 0.0, 0.0, 0, 6.0, 12.0)
show_hudmessage(id, "Cs 1.6 ")


azon belül ezt a részt:
Kód:
// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban.
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60 -->itt tudod megadni az időket

_________________
Kép

Ők köszönték meg alfaanero nek ezt a hozzászólást: AsD# (2015.01.11. 14:22)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: plmenu.
HozzászólásElküldve: 2015.01.11. 14:22 
Offline
Senior Tag

Csatlakozott: 2013.07.29. 13:15
Hozzászólások: 233
Megköszönt másnak: 125 alkalommal
köszönöm szépen! és a 2. részében tudnál segíteni még?


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


Ki van itt

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