Raised This Month: $ Target: $400
 0% 

Making menus that shows new menu.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kikifrh
Senior Member
Join Date: May 2009
Old 07-25-2010 , 13:46   Making menus that shows new menu.
Reply With Quote #1

Hi guys, I'm having problems tring to make the menus to a plugin. It should be a main menu that redirects you to other menus. I tried, but it's buggy. Can someone remake this to me? I just need a main menu and redirects to menu #2 (it should have exit command on main menu, and exit and back [go back to main menu] on #2 menu.)

Thx a lot, this means a lot to me.
kikifrh is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 07-25-2010 , 13:56   Re: Making menus that shows new menu.
Reply With Quote #2

Huh?
__________________
RedRobster is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-25-2010 , 14:01   Re: Making menus that shows new menu.
Reply With Quote #3

Quote:
Originally Posted by RedRobster View Post
Huh?
Sub-menu.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 07-25-2010 , 14:03   Re: Making menus that shows new menu.
Reply With Quote #4

Quote:
Originally Posted by GXLZPGX View Post
Sub-menu.
Yeah, I know, but does he just want someone to make the structure of a menu to show him? Or what? Haha. That's what my "huh?" was for.
RedRobster is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-25-2010 , 14:09   Re: Making menus that shows new menu.
Reply With Quote #5

Simple sub-menu structure with 3 items already set up in the sub-menu.

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>

#define PLUGIN    "Menu & Submenu"
#define AUTHOR    "Shadow"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say /menu""cmdMenu" )
}

public 
cmdMenuid )
{
    new 
menu menu_create"\yMain Menu""menu_handler" )
    
menu_additemmenu"Sub-Menu""0")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
menu_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
    switch( 
key )
    {
        case 
0:
        {
            
cmdSubMenuid );
        }
    }
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}

public 
cmdSubMenuid )
{
    new 
menu menu_create"\ySub-Menu""submenu_handler" )
    
menu_additemmenu"Item #1""0")
    
menu_additemmenu"Item #2""1")
    
menu_additemmenu"Item #3""2")
    
menu_additemmenu"Back""3")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
submenu_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
    switch( 
key )
    {
        case 
0:
        {
            
//item #1
        
}
        case 
1:
        {
            
//item #2
        
}
        case 
2:
        {
            
//item #3
        
}
        case 
3:
        {
            
cmdMenuid )
        }
    }
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

Quote:
Originally Posted by RedRobster View Post
Yeah, I know, but does he just want someone to make the structure of a menu to show him? Or what? Haha. That's what my "huh?" was for.
As for that, I have no damn clue lol.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 07-25-2010 at 14:17.
GXLZPGX 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 00:16.


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