AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help !! (https://forums.alliedmods.net/showthread.php?t=225937)

med 09-11-2013 07:24

need help !!
 
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 09-11-2013 07:58

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

Then what?

simanovich 09-11-2013 09:13

Re: need help !!
 
Make another menu

med 09-11-2013 09:20

Re: need help !!
 
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 !

~Ice*shOt 09-11-2013 09:26

Re: need help !!
 
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

JusTGo 09-11-2013 09:37

Re: need help !!
 
try to use sub menu:
https://forums.alliedmods.net/showthread.php?t=46364

HamletEagle 09-11-2013 10:13

Re: need help !!
 
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;
 }


med 09-11-2013 10:24

Re: need help !!
 
ty i will try it ........


All times are GMT -4. The time now is 18:58.

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