hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.24. 09:52



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot], Majestic-12 [Bot] 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ő


Lezárt fórum  A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [ 1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: HELP PLS!
HozzászólásElküldve: 2015.05.14. 19:33 
Offline
Újonc

Csatlakozott: 2015.05.14. 16:48
Hozzászólások: 1
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2. * Simple Clanwar Management 1.1
  3. * by rhin0
  4. *
  5. *
  6. * Simple AMXModX plugin for managing clanwars.
  7. * Currently, there are these commands available:
  8. *
  9. * say /start - 3x restart and start the match
  10. * say /stop - stop the match
  11. * say /rr - restart round
  12. * say /knife - play knife round
  13. * say /scmhelp - display help in MOTD window
  14. * say /<mapname minus de_ prefix> (ie. say /dust2, say /cpl_mill, etc.) - change map
  15. *
  16. * Changelog:
  17. * 1.1 (17.2.2008)
  18. * - fixed loading maps from maplist.ini file
  19. * - dictionary is now loaded as expected
  20. * 1.0 (8.1.2007)
  21. * - available map commands are now loaded from maplist.ini file
  22. * - added multilingual support
  23. * - new command say /knife to play knife round (thanks to Dupl3xx)
  24. * - help is now displayed in MOTD window
  25. * - cw.cfg resp. warmup.cfg is executed on startup resp. in the end, of the match (thanks to Dupl3xx)
  26. * 0.8 (5.4.2006)
  27. * - SCM plugin is no longer compatible with AMXMod
  28. * - SCM commands now available only to admins with access to menu (flag u) - can be changed
  29. * - help message when player connects cannot be disabled anymore
  30. * 0.7 (3.4.2006) - last version vith AMXMod support
  31. * - help message now displayed only once when player connects - can be disabled completely
  32. * - new command say /scmhelp to display help
  33. * - few small tweaks
  34. * 0.6 (22.2.2006)
  35. * - disabled changing map when match is started
  36. * - improved command say /stop
  37. * 0.5 (21.2.2006) - never released to public
  38. * - commands to switch to six most played maps (de_cbble, de_cpl_mill, de_dust2, de_inferno, de_nuke, de_train)
  39. * - new commands are:
  40. * - say /cbble
  41. * - say /cpl_mill
  42. * - say /dust2
  43. * - say /inferno
  44. * - say /nuke
  45. * - say /train
  46. * 0.2 (20.2.2006)
  47. * - option to switch between AMXModX and AMXMod (see lines below)
  48. * 0.1 (16.2.2006)
  49. * - initial release
  50. *
  51. */
  52.  
  53. //#define ADMINS_ONLY // comment this line to allow SCM commands for all players
  54.  
  55. #define MAX_MAPS 128 // max number of maps in map list (if you need more maps, just change this value to suits your needs)
  56.  
  57. #define SCM_DICT "scm.txt"
  58. #define SCM_MAPS "maplist.ini"
  59. #define SCM_CW "cw.cfg"
  60. #define SCM_WARM "warmup.cfg"
  61.  
  62. // DO NOT EDIT BELOW
  63. #include <amxmodx>
  64. #include <amxmisc>
  65. #include <fun>
  66.  
  67. #define PLUGIN "Simple Clanwar Management"
  68. #define VERSION "1.1"
  69. #define AUTHOR "rhin0"
  70.  
  71. new g_match_inprogress = 0
  72.  
  73. new g_mapnames[MAX_MAPS][32]
  74. new g_mapcount
  75.  
  76. new g_filename[256]
  77.  
  78. public plugin_init() {
  79. register_plugin(PLUGIN, VERSION, AUTHOR)
  80.  
  81. register_clcmd("say", "check_map", 0, "- [SCM] check if the user say map change command")
  82.  
  83. register_clcmd("say /start", "cmd_start", 0, "- [SCM] 3x restart and start the match")
  84. register_clcmd("say /stop", "cmd_stop", 0, "- [SCM] stop the match")
  85. register_clcmd("say /rr", "cmd_rr", 0, "- [SCM] restart round")
  86. register_clcmd("say /knife", "cmd_knives", 0, "- [SCM] kniferound")
  87. register_clcmd("say /scmhelp", "cmd_showhelp", 0, "- [SCM] show help (MOTD)")
  88.  
  89. register_dictionary(SCM_DICT)
  90.  
  91. read_maps()
  92. }
  93.  
  94. #if defined ADMINS_ONLY
  95. public client_putinserver(id) {
  96. if (access(id, ADMIN_MENU)) {
  97. if (is_user_bot(id)) return
  98. set_task(10.0, "showhelp", id)
  99. } else return
  100. }
  101.  
  102. public client_disconnect(id) {
  103. remove_task(id)
  104. }
  105. #else
  106. public client_putinserver(id) {
  107. if (is_user_bot(id))
  108. return
  109. set_task(10.0, "showhelp", id)
  110. }
  111.  
  112. public client_disconnect(id) {
  113. remove_task(id)
  114. }
  115. #endif
  116.  
  117. public read_maps() {
  118. new textlength
  119.  
  120. get_filename(SCM_MAPS)
  121.  
  122. new line = 0
  123. while (line < MAX_MAPS && read_file(g_filename, line, g_mapnames[line], 30, textlength)) {
  124. ++line
  125. }
  126. log_message("SCM: loaded %i maps", line)
  127. g_mapcount = line
  128. }
  129.  
  130. public check_map(id) {
  131. new said[192]
  132. read_args(said, 191)
  133.  
  134. new i = 0
  135. while (i < g_mapcount) {
  136. new trash[16], mapname[32]
  137. strtok(g_mapnames[i], trash, 15, mapname, 31, '_')
  138. format(mapname, 31, "^"/%s^"", mapname)
  139. if (equali(said, mapname)) {
  140. cmd_changemap(id, g_mapnames[i])
  141. }
  142. ++i
  143. }
  144. }
  145.  
  146. public cmd_changemap(id, mapname[]) {
  147. #if defined ADMINS_ONLY
  148. if (!access(id, ADMIN_MENU)) {
  149. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  150. return PLUGIN_HANDLED
  151. }
  152. #endif
  153. if (g_match_inprogress != 1) {
  154. set_task(2.0, "change_map", 0, mapname, strlen(mapname))
  155.  
  156. new message[64]
  157. format(message, 63, "%L", id, "CHANGELEVEL", mapname)
  158. all_msg(message)
  159. } else {
  160. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_CHANGE_MAP")
  161. }
  162.  
  163. return PLUGIN_CONTINUE
  164. }
  165.  
  166. public cmd_knives(id) {
  167. #if defined ADMINS_ONLY
  168. if (!access(id, ADMIN_MENU)) {
  169. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  170. return PLUGIN_HANDLED
  171. }
  172. #endif
  173. if (g_match_inprogress != 1) {
  174. g_match_inprogress = 0
  175.  
  176. set_task(1.0, "restart_round", 0, "1", 1)
  177. all_msg("knife round")
  178. set_task(3.0, "strip_weapons")
  179. set_task(4.0, "knife_msg")
  180. } else {
  181. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_STOP_MATCH")
  182. }
  183.  
  184. return PLUGIN_CONTINUE
  185. }
  186.  
  187. public cmd_start(id) {
  188. #if defined ADMINS_ONLY
  189. if (!access(id, ADMIN_MENU)) {
  190. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  191. return PLUGIN_HANDLED
  192. }
  193. #endif
  194. if (g_match_inprogress != 1) {
  195. set_task(1.0, "restart_round", 0, "1", 1)
  196. all_msg("starting match")
  197. g_match_inprogress = 1
  198.  
  199. get_filename(SCM_CW)
  200. server_cmd("exec %s", g_filename)
  201. client_print(0, print_chat, "[SCM] !!! %L", LANG_PLAYER, "CWTG_CFG_LOADED")
  202.  
  203. set_task(3.0, "restart_round", 0, "1", 1)
  204. set_task(5.0, "restart_round", 0, "3", 1)
  205. set_task(9.0, "live_msg")
  206. } else {
  207. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_START_MATCH")
  208. }
  209.  
  210. return PLUGIN_CONTINUE
  211. }
  212.  
  213. public cmd_stop(id) {
  214. #if defined ADMINS_ONLY
  215. if (!access(id, ADMIN_MENU)) {
  216. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  217. return PLUGIN_HANDLED
  218. }
  219. #endif
  220. if (g_match_inprogress == 1) {
  221. all_msg("stopping match")
  222. g_match_inprogress = 0
  223.  
  224. get_filename(SCM_WARM)
  225. server_cmd("exec %s", g_filename)
  226. client_print(0, print_chat, "[SCM] !!! %L", LANG_PLAYER, "WRM_CFG_LOADED")
  227.  
  228. set_task(3.0, "restart_round", 0, "1", 1)
  229. set_task(6.0, "all_msg", 0, "match stopped", 13)
  230. } else {
  231. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_STOP_MATCH")
  232. }
  233.  
  234. return PLUGIN_CONTINUE
  235. }
  236.  
  237. public cmd_rr(id) {
  238. #if defined ADMINS_ONLY
  239. if (!access(id, ADMIN_MENU)) {
  240. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  241. return PLUGIN_HANDLED
  242. }
  243. #endif
  244. if (g_match_inprogress != 1) {
  245. set_task(1.0, "restart_round", 0, "1", 1)
  246. all_msg("restart")
  247. } else {
  248. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_RESTART_MATCH")
  249. }
  250.  
  251. return PLUGIN_CONTINUE
  252. }
  253.  
  254. public strip_weapons() {
  255. new plist_public[32], pnum_public
  256. get_players(plist_public, pnum_public)
  257. for (new i = 0; i < pnum_public; i++) {
  258. if (is_user_connected(plist_public[i]) == 1 && is_user_alive(plist_public[i]) == 1){
  259. strip_user_weapons(plist_public[i])
  260. give_item(plist_public[i], "weapon_knife")
  261. }
  262. }
  263. }
  264.  
  265. public get_filename(filename[]) {
  266.  
  267. new dir[128]
  268.  
  269. get_configsdir(dir, 127)
  270. format(g_filename, 255, "%s/scm/%s", dir, filename)
  271.  
  272. if (!file_exists(g_filename)) {
  273. log_message("SCM: file %s not found", filename)
  274. return PLUGIN_HANDLED
  275. }
  276.  
  277. return PLUGIN_CONTINUE
  278. }
  279.  
  280. public change_map(map[]) {
  281. server_cmd("changelevel %s", map)
  282.  
  283. return PLUGIN_CONTINUE
  284. }
  285.  
  286. public restart_round(seconds[]) {
  287. server_cmd("sv_restartround %s", seconds)
  288.  
  289. return PLUGIN_CONTINUE
  290. }
  291.  
  292. public live_msg() {
  293. set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0)
  294. show_hudmessage(0, "--- live - live - live ---^n--- live - live - live ---^n--- live - live - live ---")
  295. client_print(0, print_chat, "*** live - live - live ***")
  296. client_print(0, print_chat, "*** live - live - live ***")
  297. client_print(0, print_chat, "*** live - live - live ***")
  298.  
  299. return PLUGIN_CONTINUE
  300. }
  301.  
  302. public knife_msg() {
  303. set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0)
  304. show_hudmessage(0, "--- knife round - knife round - knife round ---^n--- knife round - knife round - knife round ---^n--- knife round - knife round - knife round ---")
  305. client_print(0, print_chat, "*** knife round - knife round - knife round ***")
  306. client_print(0, print_chat, "*** knife round - knife round - knife round ***")
  307. client_print(0, print_chat, "*** knife round - knife round - knife round ***")
  308. return PLUGIN_CONTINUE
  309. }
  310.  
  311. public all_msg(msg[]) {
  312. set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0)
  313. show_hudmessage(0, "--- %s ---", msg)
  314. client_print(0, print_chat, "*** %s ***", msg)
  315.  
  316. return PLUGIN_CONTINUE
  317. }
  318.  
  319. public showhelp(id) {
  320. #if defined ADMINS_ONLY
  321. if (!access(id, ADMIN_MENU)) {
  322. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  323. return PLUGIN_HANDLED
  324. }
  325. #endif
  326. client_print(id, print_chat, "[SCM] %L", id, "HELP_START_STOP")
  327. client_print(id, print_chat, "[SCM] %L", id, "HELP_RR")
  328. client_print(id, print_chat, "[SCM] %L", id, "HELP_MOTD")
  329.  
  330. return PLUGIN_CONTINUE
  331. }
  332.  
  333. public cmd_showhelp(id) {
  334. new motd[2048], line[256], title[64]
  335.  
  336. add(motd, 2047, "<html><head><style>")
  337. add(motd, 2047, "body {font-family: Tahoma; font-size: 12px}")
  338. add(motd, 2047, "code {font-size: 14px; margin: 0 10px 0 0}")
  339. add(motd, 2047, "h1 {font-size: 18px; text-align: center}")
  340. add(motd, 2047, "h2 {font-size: 14px; font-weight: bold}")
  341. add(motd, 2047, "p {text-align: center; margin: 5px}")
  342. add(motd, 2047, "a {color: #991A00}")
  343. add(motd, 2047, "</style></head><body>")
  344. add(motd, 2047, "<div>")
  345. format(line, 255, "<h1>%s %s (SCM)</h1>", PLUGIN, VERSION)
  346. add(motd, 2047, line)
  347. format(line, 255, "<p>%L <strong>rhin0</strong></p>", id, "MOTD_CREDITS")
  348. add(motd, 2047, line)
  349. format(line, 255, "<p>%L <a href=http://www.counterserver.cz>www.CounterServer.cz</a></p>", id, "MOTD_INFO")
  350. add(motd, 2047, line)
  351. format(line, 255, "<h2>%L</h2>", id, "MOTD_GEN_CMD")
  352. add(motd, 2047, line)
  353. format(line, 255, "<ul><li><code>say /start</code> // %L</li>", id, "MOTD_START_MATCH")
  354. add(motd, 2047, line)
  355. format(line, 255, "<li><code>say /stop</code> // %L</li>", id, "MOTD_STOP_MATCH")
  356. add(motd, 2047, line)
  357. format(line, 255, "<li><code>say /rr</code> // %L</li>", id, "MOTD_RESTART_MATCH")
  358. add(motd, 2047, line)
  359. format(line, 255, "<li><code>say /scmhelp</code> // %L</li></ul>", id, "MOTD_SHOW_HELP")
  360. add(motd, 2047, line)
  361. format(line, 255, "<h2>%L</h2>", id, "MOTD_MAPS_CMD")
  362. add(motd, 2047, line)
  363. add(motd, 2047, "<ul>")
  364.  
  365. new i = 0
  366. while (i < g_mapcount) {
  367. new mapcmd[128], trash[16], mapname[32]
  368. strtok(g_mapnames[i], trash, 15, mapname, 31, '_')
  369. format(mapcmd, 127, "<li><code>say /%s</code> // %L %s</li>", mapname, id, "MOTD_CHANGELEVEL", g_mapnames[i])
  370. add(motd, 2047, mapcmd)
  371. ++i
  372. }
  373.  
  374. add(motd, 2047, "</ul>")
  375. add(motd, 2047, "</div></body></html>")
  376. format(title, 63, "%s %s", PLUGIN, VERSION)
  377. show_motd(id, motd, title)
  378.  
  379. return PLUGIN_HANDLED
  380. }


EZT kellene beleírni és áttalakítani AMXX é! nekem valahogy nem sikerült :| HELP :S
SMA Forráskód: [ Mindet kijelol ]
  1. public cmd_start(id) {
  2. if(get_user_flags(id)&ADMIN_MENU)
  3. {
  4. #if defined ADMINS_ONLY
  5. if (!access(id, ADMIN_MENU)) {
  6. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  7. return PLUGIN_HANDLED
  8. }
  9. #endif
  10. if (g_match_inprogress != 1) {
  11. set_task(1.0, "restart_round", 0, "1", 1)
  12. all_msg("starting match")
  13. g_match_inprogress = 1
  14.  
  15. get_filename(SCM_CW)
  16. server_cmd("exec %s", g_filename)
  17. client_print(0, print_chat, "[SCM] !!! %L", LANG_PLAYER, "CWTG_CFG_LOADED")
  18.  
  19. set_task(3.0, "restart_round", 0, "1", 1)
  20. set_task(5.0, "restart_round", 0, "3", 1)
  21. set_task(9.0, "live_msg")
  22. } else {
  23. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_START_MATCH")
  24. }
  25. }
  26. return PLUGIN_CONTINUE
  27. }
  28.  
  29. public cmd_stop(id) {
  30. if(get_user_flags(id)&ADMIN_MENU)
  31. {
  32. #if defined ADMINS_ONLY
  33. if (!access(id, ADMIN_MENU)) {
  34. client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS")
  35. return PLUGIN_HANDLED
  36. }
  37. #endif
  38. if (g_match_inprogress == 1) {
  39. all_msg("stopping match")
  40. g_match_inprogress = 0
  41.  
  42. get_filename(SCM_WARM)
  43. server_cmd("exec %s", g_filename)
  44. client_print(0, print_chat, "[SCM] !!! %L", LANG_PLAYER, "WRM_CFG_LOADED")
  45.  
  46. set_task(3.0, "restart_round", 0, "1", 1)
  47. set_task(6.0, "all_msg", 0, "match stopped", 13)
  48. } else {
  49. client_print(id, print_chat, "[SCM] !!! %L", id, "CANNOT_STOP_MATCH")
  50. }
  51. }
  52. return PLUGIN_CONTINUE
  53. }


Hozzászólás jelentése
Vissza a tetejére
   
 
Hozzászólások megjelenítése:  Rendezés  
Lezárt fórum  A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [ 1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 17 vendég


Nem nyithatsz témákat ebben a fórumban.
Nem 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