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':
{
client_cmd(id, "amx_tbmenu")
}
case '2':
{
set_cvar_num("df_hook_on", 1)
}
case '3':
{
set_cvar_num("df_hook_on", 0)
}
case '4':
{
client_cmd(id, "amx_calmenu")
}
case '5':
{
client_cmd(id, "csdm_menu")
}
case '6':
{
client_cmd(id, "amx_nade *")
}
case '7':
{
client_cmd(id, "amx_unnade *")
}
}
return PLUGIN_HANDLED
}
thanks fatalisdk, you put the wrong thing for cal menu and amx_nade is a client I think cause it worked after I changed it