В какой строке можно убрать Plugin Cvars и Plugin Commands?
/* AMX Mod X * Menus Front-End Plugin * * by the AMX Mod X Development Team * originally developed by OLO * * This file is part of AMX Mod X. * * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */
new g_menuPosition[33] new g_menusNumber = 0 new g_menuBody[MAXMENUS][STRINGSIZE] new bool:g_menuBodyPhrase[MAXMENUS] new g_menuCmd[MAXMENUS][STRINGSIZE] new g_menuAccess[MAXMENUS] new g_menuPlugin[MAXMENUS][STRINGSIZE]
new g_coloredMenus
new g_clientMenuPosition[33] new g_clientMenusNumber = 0 new g_clientMenuBody[MAXMENUS][STRINGSIZE] new bool:g_clientMenuBodyPhrase[MAXMENUS] new g_clientMenuCmd[MAXMENUS][STRINGSIZE] new g_clientMenuAccess[MAXMENUS] new g_clientMenuPlugin[MAXMENUS][STRINGSIZE]
// menuBody: Text that will be shown for this item in menu // menuCmd: Command that should be executed to start menu // menuAccess: Access required for menu // menuPlugin: The exact case-insensitive name of plugin holding the menu command public AddMenu(const menuBody[], const menuCmd[], const menuAccess, const menuPlugin[]) { if (g_menusNumber + 1 == MAXMENUS) { log_amx("Error: Plugin ^"%s^" tried to add a menu item to Menu Front-End plugin with maximum menu items reached!", menuPlugin) return }
g_menusNumber++ server_print("Menu item %d added to Menus Front-End: ^"%s^" from plugin ^"%s^"", g_menusNumber, menuBody, menuPlugin) }
public AddMenuLang(const menuBody[], const menuCmd[], const menuAccess, const menuPlugin[]) { if (g_menusNumber + 1 == MAXMENUS) { log_amx("Error: Plugin ^"%s^" tried to add a menu item to Menu Front-End plugin with maximum menu items reached!", menuPlugin) return }
//server_print("Menu item %d added to Menus Front-End: ^"%s^" (LANG) from plugin ^"%s^"", g_menusNumber, menuBody, menuPlugin) }
public AddClientMenu(const menuBody[], const menuCmd[], const menuAccess, const menuPlugin[]) { if (g_clientMenusNumber + 1 == MAXMENUS) { log_amx("Error: Plugin ^"%s^" tried to add a menu item to Menu Front-End plugin with maximum menu items reached!", menuPlugin) return }
g_coloredMenus ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos + 1, (g_menusNumber / MENUITEMSPERPAGE) + (((g_menusNumber % MENUITEMSPERPAGE) > 0) ? 1 : 0))
new end = start + MENUITEMSPERPAGE new keys = MENU_KEY_0
if (end > g_menusNumber) // MENUS_NUMBER end = g_menusNumber // MENUS_NUMBER
for (new a = start; a < end; ++a) { if ( access(id, g_menuAccess[a]) && ((is_plugin_loaded(g_menuPlugin[a]) != -1) || // search plugins for registered name (is_plugin_loaded(g_menuPlugin[a], true) != -1))) // search plugins for filename { keys |= (1<<b)
if (g_menuBodyPhrase[a]) len += format(menuBody[len], 511-len, "%d. %L^n", ++b, id, g_menuBody[a]) else len += format(menuBody[len], 511-len, "%d. %s^n", ++b, g_menuBody[a]) } else { ++b
if (g_coloredMenus) { if (g_menuBodyPhrase[a]) len += format(menuBody[len], 511-len, "\d%d. %L^n\w", b, id, g_menuBody[a]) else len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, g_menuBody[a]) } else { if (g_menuBodyPhrase[a]) len += format(menuBody[len], 511-len, "#. %L^n", id, g_menuBody[a]) else len += format(menuBody[len], 511-len, "#. %s^n", g_menuBody[a]) } } }
new len = format(menuBody, 511, g_coloredMenus ? "\yAMX Mod X Client Menu\R%d/%d^n\w^n" : "AMX Mod X Client Menu %d/%d^n^n" , pos + 1, (g_clientMenusNumber / MENUITEMSPERPAGE) + (((g_clientMenusNumber % MENUITEMSPERPAGE) > 0) ? 1 : 0))
new end = start + MENUITEMSPERPAGE new keys = MENU_KEY_0
if (end > g_clientMenusNumber) // MENUS_NUMBER end = g_clientMenusNumber // MENUS_NUMBER
for (new a = start; a < end; ++a) { if ( access(id, g_clientMenuAccess[a]) && ((is_plugin_loaded(g_clientMenuPlugin[a]) != -1) || // search plugins for registered name (is_plugin_loaded(g_clientMenuPlugin[a], true) != -1))) // search plugins for file name { keys |= (1<<b)
if (g_clientMenuBodyPhrase[a]) len += format(menuBody[len], 511-len, "%d. %L^n", ++b, id, g_clientMenuBody[a]) else len += format(menuBody[len], 511-len, "%d. %s^n", ++b, g_clientMenuBody[a]) } else { ++b
if (g_coloredMenus) { if (g_clientMenuBodyPhrase[a]) len += format(menuBody[len], 511-len, "\d%d. %L^n\w", b, id, g_clientMenuBody[a]) else len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, g_clientMenuBody[a]) } else { if (g_clientMenuBodyPhrase[a]) len += format(menuBody[len], 511-len, "#. %L^n", id, g_clientMenuBody[a]) else len += format(menuBody[len], 511-len, "#. %s^n", g_clientMenuBody[a]) } } }
public plugin_init() { register_plugin("Menus Front-End", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("menufront.txt") register_dictionary("common.txt")
register_menucmd(register_menuid("AMX Mod X Menu"), 1023, "actionMenu") register_menucmd(register_menuid("AMX Mod X Client Menu"), 1023, "clientActionMenu") register_clcmd("amxmodmenu", "cmdMenu", ADMIN_MENU, "- displays menus") register_clcmd("amx_menu", "clientCmdMenu", 0, "- displays menus available to client")
register_srvcmd("amx_addmenuitem", "addmenuitem_cmd", 0, "<menu text> <menu command> <access flags> <plugin name | plugin filename> - Add a menu item to Menus Front-End") register_srvcmd("amx_addclientmenuitem", "addclientmenuitem_cmd", 0, "<menu text> <menu command> <access flags> <plugin name | plugin filename> - Add a menu item to Client Menus Front-End")
g_coloredMenus = colored_menus()
} public plugin_cfg() { AddDefaultMenus()
new configs[128] get_configsdir(configs, 127) server_cmd("exec %s/custommenuitems.cfg", configs) }
Skype: revenge608
Сообщение отредактировал Revenge - Суббота, 30.06.2012, 22:44