Raised This Month: $ Target: $400
 0% 

need help !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
med
Member
Join Date: Mar 2013
Old 09-11-2013 , 07:24   need help !!
Reply With Quote #1

Hi guys
how to make menu inside an other menu !!!
Exemple :
Menu buy
inside (Menu buy ) we found
1.Extra items
2.Weapon Menu
3.Vip menu

Hope u understand me .............
__________________
med is offline
Send a message via Skype™ to med
Old 09-11-2013, 07:27
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: random answer
med
Member
Join Date: Mar 2013
Old 09-11-2013 , 07:58   Re: need help !!
Reply With Quote #3

// 1. Menu Buys
if (get_pcvar_num(cvar_buycustom))
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Buy menus^n")

Then what?
__________________
med is offline
Send a message via Skype™ to med
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-11-2013 , 09:13   Re: need help !!
Reply With Quote #4

Make another menu
__________________
simanovich is offline
med
Member
Join Date: Mar 2013
Old 09-11-2013 , 09:20   Re: need help !!
Reply With Quote #5

how ?

// 1. Menu Buys
if (get_pcvar_num(cvar_buycustom))
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Buy menus^n")


how to put another menu inside this !
__________________
med is offline
Send a message via Skype™ to med
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-11-2013 , 09:26   Re: need help !!
Reply With Quote #6

Using new amxx menu system, in handler case add other menu open func., for eg.

case 1: Open_other_menu(id) // key 1 pressed
case 2: Open_other_menu2(id) // key 2 pressed
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-11-2013 , 09:37   Re: need help !!
Reply With Quote #7

try to use sub menu:
https://forums.alliedmods.net/showthread.php?t=46364
JusTGo is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-11-2013 , 10:13   Re: need help !!
Reply With Quote #8

Try this code and edit it how you want.I assume that you know the basic of new amxx style menu so I won't add more comments.

Code:
 #include <amxmodx>

 public plugin_init()
 {
    register_clcmd( "/buy","BuyMenu" );
 }
 public BuyMenu( id )
 {
    new menu = menu_create( "\rBuy menu:", "menu_handler" )

    menu_additem( menu, "\wOption 1", "", 0 );
    
    menu_display( id, menu, 0 );
 }
 public menu_handler( id, menu, item )
 {
    switch( item )
    {
        case 0:
        {
              SubMenu( id ); //show the sub-menu when option 1 is pressed in BuyMenu
        }
       
       
    }

    menu_destroy( menu );
    return PLUGIN_HANDLED;
 }

 SubMenu( id ) //this is our sub-menu
 {
  
    new menu = menu_create( "\rBuy sub-menu:", "submenu_handler" )

    menu_additem( menu, "\wOption 1", "", 0 );
    menu_additem( menu, "\wOption 2", "", 0 );

    menu_display( id, menu, 0 );
 }
 public submenu_handler( id, menu, item )
 {
    switch( item )
    {
        case 0:
        {
            //do something
        }
        case 1:
        {
           //do something
        }
      
    }

    menu_destroy( menu );
    return PLUGIN_HANDLED;
 }

Last edited by HamletEagle; 09-11-2013 at 10:15.
HamletEagle is offline
med
Member
Join Date: Mar 2013
Old 09-11-2013 , 10:24   Re: need help !!
Reply With Quote #9

ty i will try it ........
__________________
med is offline
Send a message via Skype™ to med
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 08:52.


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