the DF_hook_on is working but when i type amx_hookmenu and pick 1 or 2 it closes and when i type amx_hookonmenu and push 1 or 2 it works great but when I type amx_hookgroundmenu and push 1 or 2 it the menu closes
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Hook Menu","1.0","[iwek]Nightscream")
register_clcmd("amx_hookmenu","CmdHookMenu",ADMIN_MENU, "- Displays The hookmenu")
register_clcmd("amx_hookonmenu","CmdHookOnMenu",ADMIN_MENU,"- Displays the hook on and off menu")
register_clcmd("amx_hookgroundmenu","CmdHookGroundMenu",ADMIN_MENU,"- Displays the ground menu")
register_menucmd(register_menuid("Hook Menu"),1023,"actionHookmenu")
register_menucmd(register_menuid("Hook on and off Menu"),1023,"actionHookonmenu")
register_menucmd(register_menuid("Hook ground Menu"),1023,"actionHookgroundmenu")
return PLUGIN_CONTINUE
}
/*-------------------------------------Main Menu------------------------------------------------*/
public actionHookmenu(id, key) {
switch(key) {
case 0: {
client_cmd(id,"amx_hookonmenu")
}
case 1: {
client_cmd(id,"amx_hookgroundmenu")
}
}
return PLUGIN_HANDLED
}
public CmdHookMenu(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new menu[256]
format(menu, 255, "\yHookmod menu^n^n\w1. Hook on and off menu^n\w2. Hook ground menu^n\w0. Exit")
show_menu(id,((1<<0)|(1<<1)|(1<<2)), menu)
return PLUGIN_HANDLED
}
/*--------------------------------Hook on and off Menu------------------------------------------*/
public actionHookonmenu(id,key) {
switch(key) {
case 0: {
set_cvar_num("DF_hook_on",0);
client_print(id,print_chat,"[HookMod]hook is now off");
}
case 1: {
set_cvar_num("DF_hook_on",1);
client_print(id,print_chat,"[HookMod]hook is now on");
}
}
return PLUGIN_HANDLED
}
public CmdHookOnMenu(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new menu[256]
format(menu, 255, "\yHook on and off Menu^n^n\w1. Hook off^n\w2. Hook on^n\w3. Back^n\w0. Exit")
show_menu(id,((1<<0)|(1<<1)|(1<<9)), menu)
return PLUGIN_HANDLED
}
/*---------------------------------Hook ground Menu---------------------------------------------*/
public actionHookgroundmenu(id,key) {
switch(key) {
case 0: {
set_cvar_num("DF_hook_ground",0);
client_print(id,print_chat,"[HookMod]players can't attach hooks on the ground");
}
case 1: {
set_cvar_num("DF_hook_ground",1);
client_print(id,print_chat,"[HookMod]players can attach hooks on the ground");
}
}
return PLUGIN_HANDLED
}
public CmdHookGroundMenu(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new menu[256]
format(menu, 255, "\yHook Ground Menu^n^n\w1. Hook ground off^n\w2. Hook ground on^n\w3. Back^n\w0. Exit")
show_menu(id,((1<<0)|(1<<1)|(1<<9)), menu)
return PLUGIN_HANDLED
}