Raised This Month: $ Target: $400
 0% 

[Solved] Menu inside a Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 07-01-2020 , 08:57   Re: Menu inside a Menu
Reply With Quote #1

Quote:
Originally Posted by +ARUKARI- View Post
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(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }

    new 
szData[6], szName[64], accesscallback;
    
menu_item_getinfo(menuitemaccessszDatacharsmax(szData), szNamecharsmax(szName), callback);

    switch (
item)
    {
        case 
0cmdSubMenu1(id);
        case 
1cmdSubMenu2(id);
        case 
2cmdSubMenu3(id);
        case 
3cmd1(id);
        case 
4cmd2(id);
        case 
5cmd3(id);
        case 
6cmd4(id);
        case 
7cmd5(id);
        case 
8cmd6(id);
        case 
9: return PLUGIN_HANDLED;
    }
    if (
item != || item != || 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;


Last edited by MaNaReaver; 07-01-2020 at 08:58.
MaNaReaver is offline
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 07-01-2020 , 09:05   Re: Menu inside a Menu
Reply With Quote #2

Quote:
Originally Posted by MaNaReaver View Post
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(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }

    new 
szData[6], szName[64], accesscallback;
    
menu_item_getinfo(menuitemaccessszDatacharsmax(szData), szNamecharsmax(szName), callback);

    switch (
item)
    {
        case 
0cmdSubMenu1(id);
        case 
1cmdSubMenu2(id);
        case 
2cmdSubMenu3(id);
        case 
3cmd1(id);
        case 
4cmd2(id);
        case 
5cmd3(id);
        case 
6cmd4(id);
        case 
7cmd5(id);
        case 
8cmd6(id);
        case 
9: return PLUGIN_HANDLED;
    }
    if (
item != || item != || 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!
MaNaReaver is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode