скажите где исходный файл и чё там нужно прописыват чтобы тока админы могли прописывать команды: /rr, /start,/stop и.т.д ??
* * Simple Clanwar Management 1.1 * by rhin0 * * http://www.CounterServer.cz * * Simple AMXModX plugin for managing clanwars. * Currently, there are these commands available: * * say /start - 3x restart and start the match * say /stop - stop the match * say /rr - restart round * say /knife - play knife round * say /scmhelp - display help in MOTD window * say /<mapname minus de_ prefix> (ie. say /dust2, say /cpl_mill, etc.) - change map * * Changelog: * 1.1 (17.2.2008) * - fixed loading maps from maplist.ini file * - dictionary is now loaded as expected * 1.0 (8.1.2007) * - available map commands are now loaded from maplist.ini file * - added multilingual support * - new command say /knife to play knife round (thanks to Dupl3xx) * - help is now displayed in MOTD window * - cw.cfg resp. warmup.cfg is executed on startup resp. in the end, of the match (thanks to Dupl3xx) * 0.8 (5.4.2006) * - SCM plugin is no longer compatible with AMXMod * - SCM commands now available only to admins with access to menu (flag u) - can be changed * - help message when player connects cannot be disabled anymore * 0.7 (3.4.2006) - last version vith AMXMod support * - help message now displayed only once when player connects - can be disabled completely * - new command say /scmhelp to display help * - few small tweaks * 0.6 (22.2.2006) * - disabled changing map when match is started * - improved command say /stop * 0.5 (21.2.2006) - never released to public * - commands to switch to six most played maps (de_cbble, de_cpl_mill, de_dust2, de_inferno, de_nuke, de_train) * - new commands are: * - say /cbble * - say /cpl_mill * - say /dust2 * - say /inferno * - say /nuke * - say /train * 0.2 (20.2.2006) * - option to switch between AMXModX and AMXMod (see lines below) * 0.1 (16.2.2006) * - initial release * *
#define ADMINS_ONLY // comment this line to allow SCM commands for all players
#define MAX_MAPS 128 // max number of maps in map list (if you need more maps, just change this value to suits your needs)
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say", "check_map", 0, "- [SCM] check if the user say map change command")
register_clcmd("say /start", "cmd_start", 0, "- [SCM] 3 рестарта и начало матча") register_clcmd("say /stop", "cmd_stop", 0, "- [SCM] Матч остоновлен") register_clcmd("say /rr", "cmd_rr", 0, "- [SCM] Рестарт раунда") register_clcmd("say /knife", "cmd_knives", 0, "- [SCM] Раунд на ножах") register_clcmd("say /scmhelp", "cmd_showhelp", 0, "- [SCM] Справка помощи (MOTD)")
register_dictionary(SCM_DICT)
read_maps() }
#if defined ADMINS_ONLY public client_putinserver(id) { if (access(id, ADMIN_MENU)) { if (is_user_bot(id)) return set_task(10.0, "showhelp", id) } else return }
public client_disconnect(id) { remove_task(id) } #else public client_putinserver(id) { if (is_user_bot(id)) return set_task(10.0, "showhelp", id) }
public client_disconnect(id) { remove_task(id) } #endif
public read_maps() { new textlength
get_filename(SCM_MAPS)
new line = 0 while (line < MAX_MAPS && read_file(g_filename, line, g_mapnames[line], 30, textlength)) { ++line } log_message("SCM: loaded %i maps", line) g_mapcount = line }
public check_map(id) { new said[192] read_args(said, 191)
new i = 0 while (i < g_mapcount) { new trash[16], mapname[32] strtok(g_mapnames[i], trash, 15, mapname, 31, '_') format(mapname, 31, "^"/%s^"", mapname) if (equali(said, mapname)) { cmd_changemap(id, g_mapnames[i]) } ++i } }
public cmd_changemap(id, mapname[]) { #if defined ADMINS_ONLY if (!access(id, ADMIN_MENU)) { client_print(id, print_chat, "[SCM] !!! %L", id, "NO_ACCESS") return PLUGIN_HANDLED } #endif if (g_match_inprogress != 1) { set_task(2.0, "change_map", 0, mapname, strlen(mapname))
public strip_weapons() { new plist_public[32], pnum_public get_players(plist_public, pnum_public) for (new i = 0; i < pnum_public; i++) { if (is_user_connected(plist_public[i]) == 1 && is_user_alive(plist_public[i]) == 1){ strip_user_weapons(plist_public[i]) give_item(plist_public[i], "weapon_knife") } } }
if (!file_exists(g_filename)) { log_message("SCM: file %s not found", filename) return PLUGIN_HANDLED }
return PLUGIN_CONTINUE }
public change_map(map[]) { server_cmd("changelevel %s", map)
return PLUGIN_CONTINUE }
public restart_round(seconds[]) { server_cmd("sv_restartround %s", seconds)
return PLUGIN_CONTINUE }
public live_msg() { set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0) show_hudmessage(0, "--- Игра - Игра - Игра ---^n--- Игра - Игра - Игра ---^n--- Игра - Игра - Игра ---") client_print(0, print_chat, "*** Игра - Игра - Игра ***") client_print(0, print_chat, "*** Игра - Игра - Игра ***") client_print(0, print_chat, "*** Игра - Игра - Игра ***")
return PLUGIN_CONTINUE }
public knife_msg() { set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0) show_hudmessage(0, "--- Раунд на ножах - Раунд на ножах - Раунд на ножах ---^n--- Раунд на ножах - Раунд на ножах - Раунд на ножах ---^n--- Раунд на ножах - Раунд на ножах - Раунд на ножах ---") client_print(0, print_chat, "*** Раунд на ножах - Раунд на ножах - Раунд на ножах ***") client_print(0, print_chat, "*** Раунд на ножах - Раунд на ножах - Раунд на ножах ***") client_print(0, print_chat, "*** Раунд на ножах - Раунд на ножах - Раунд на ножах ***") return PLUGIN_CONTINUE }
этот плагин итак админы используют, а другие не могут.
Code
#if defined ADMINS_ONLY public client_putinserver(id) { if (access([color=red]id, ADMIN_MENU[/color])) { if (is_user_bot(id)) return set_task(10.0, "showhelp", id)
ид, админ_меню означает то что доступ к функциям есть у игроков которые могут заходить в amxmodmenu