Raised This Month: $ Target: $400
 0% 

Menus keep closing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-09-2010 , 22:16   Re: Menus keep closing
Reply With Quote #3

Quote:
Originally Posted by r4ndomz View Post
I made a plugin earlier with emps menu tutorial and when i press an option the menu closes. How should i fix it? I tried to my opinion alot of ways
Like fysiks said, it's supposed to close. If you want to be able to choose another item from the same menu prior to your first choice, in the case handler, just execute the things that you want to happen and then re-display the menu.

PHP Code:
#include <amxmodx>

new m_YourMenu;

new const 
VERSION[] = "0.0.1";

public 
plugin_init() {
    
register_plugin"Menu Example"VERSION"wrecked_" );
    
    
register_clcmd"say /menu""cmd_Menu" );
}

public 
cmd_Menuid )
{
    
m_YourMenu menu_create"Example Menu""cmd_MenuHandler" );
    
    
menu_additemm_YourMenu"Example #1""1");
    
menu_additemm_YourMenu"Example #2""2");
    
    
menu_setpropm_YourMenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidm_YourMenu);
    
    return 
PLUGIN_CONTINUE;
}

public 
cmd_MenuHandleridm_YourMenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroym_YourMenu );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
sz_Name[64];
    new 
sz_Data[64];
    new 
access;
    new 
callback;
    
    
// All that good stuff
    
menu_item_getinfom_YourMenuitemaccesssz_Data5sz_Name63callback );
    
    new 
key str_to_numsz_Data );
    
    switch( 
key )
    {
        case 
1:
        {
            
// Your Stuff
            
            
menu_displayidm_YourMenu);
        }
        
        case 
2:
        {
            
// Your Stuff
            
            
menu_displayidm_YourMenu);
        }
        
        
// ...
    
}

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 02-09-2010 at 22:31. Reason: Added quick example
wrecked_ is offline
 



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 07:24.


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