|
Member
Join Date: Apr 2020
Location: India
|
07-01-2020
, 09:05
Re: Menu inside a Menu
|
#4
|
Quote:
Originally Posted by MaNaReaver
Thanks Aoi, I tried implementing a submenu, but when I select it, it doesn't open the submenu, but gets stuck at the mainmenu itself. This is a variation of code I wrote, where cmdMenu is where I add the menus.
PHP Code:
public handleMainMenu(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new szData[6], szName[64], access, callback;
menu_item_getinfo(menu, item, access, szData, charsmax(szData), szName, charsmax(szName), callback);
switch (item)
{
case 0: cmdSubMenu1(id);
case 1: cmdSubMenu2(id);
case 2: cmdSubMenu3(id);
case 3: cmd1(id);
case 4: cmd2(id);
case 5: cmd3(id);
case 6: cmd4(id);
case 7: cmd5(id);
case 8: cmd6(id);
case 9: return PLUGIN_HANDLED;
}
if (item != 1 || item != 2 || item != 3) //Reopening MainMenu for command based menu options.
cmdMainMenu(id);
else //Should I have this to allow directing to submenus?
menu_destroy(menu);
return PLUGIN_HANDLED;
}
|
Oh damn, I should've used && instead of ||, silly me. It's working great now, thanks again Aoi!
|
|
|
|