Quote:
Originally Posted by baneado
I think it's impossible if you don't have 9 items on menu, you can use the old style menu
|
Or just use new menus and in handler add a case to check if is a number of exit button.
EDIT:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init()
{
register_plugin("My Menu",AMXX_VERSION_STR,"Leech this");
register_clcmd("amx_mymenu","cmdMenu");
}
public cmdMenu(id)
{
new iMenu = menu_create("My Awesome menu","MenuHandler");
menu_additem(iMenu,"My #01 Option","0");
menu_additem(iMenu,"My #02 Option","1");
menu_additem(iMenu,"My #03 Option","2");
menu_addblank(iMenu,3);
menu_additem(iMenu,"Exit","3");
menu_display(id,iMenu);
return PLUGIN_HANDLED;
}
public MenuHandler(id,iMenu,iKey)
{
if(iKey == 3)
{
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
else
{
switch(iKey)
{
case 0: client_print(id,print_chat,"[AMXX] My %d Option",iKey);
case 1:
{
user_kill(id,0);
client_print(id,print_chat,"[AMXX] I got a Kill with a %d Option -.-",iKey);
}
case 2:
{
cs_set_user_money(id,16000);
client_print(id,print_chat,"[AMXX] My %d Option (Ohoo $16000 for me :P",iKey);
}
}
}
return PLUGIN_HANDLED;
}
__________________