I am trying to make this menu so I can access common cmds and command menus. #1, 4, 5,6, and 7 don't work.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "tb Menu"
#define VERSION "0.1"
#define AUTHOR "tbonus"
new g_Menu
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /tbmenu", "Menu_Command", ADMIN_CFG)
register_clcmd("amx_tbsmenu", "Menu_Command", ADMIN_CFG)
g_Menu = menu_create("tb's Menu", "Menu_Handle")
menu_additem(g_Menu, "Go to tb's amxmodmenu", "1")
menu_additem(g_Menu, "Hook on", "2")
menu_additem(g_Menu, "Hook off", "3")
menu_additem(g_Menu, "CAL menu", "4")
menu_additem(g_Menu, "csdm_menu", "5")
menu_additem(g_Menu, "Unlimited Nades", "6")
menu_additem(g_Menu, "Unlimited Nades off", "7")
}
public Menu_Command(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
menu_display(id, g_Menu, 0)
return PLUGIN_HANDLED
}
public Menu_Handle(id, Menu, Item)
{
new szCommand[3], Accesss, Callback
menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)
switch(szCommand[0])
{
case '-':
{
return PLUGIN_HANDLED
}
case '1':
{
server_cmd("amx_tbmenu")
}
case '2':
{
server_cmd("df_hook_on 1")
}
case '3':
{
server_cmd("df_hook_on 0")
}
case '4':
{
server_cmd("amx_calmenu")
}
case '5':
{
server_cmd("csdm_menu")
}
case '6':
{
server_cmd("amx_nade *all")
}
case '7':
{
server_cmd("amx_unnade *all")
}
}
return PLUGIN_HANDLED
}