Raised This Month: $ Target: $400
 0% 

Menu will disappear after the round .


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Splot
Junior Member
Join Date: Nov 2011
Old 11-14-2011 , 09:10   Menu will disappear after the round .
Reply With Quote #1

hello everyone ,

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHamHam_Spawn"player""Player_Spawn");
}

public 
Player_Spawn(id)
{
    
menu(id)    
}

public 
menu(id)
{        
        new 
menu1 menu_create("menu""sub_menu")
        
        
menu_additem(menu1"options 1""1"0);
        
menu_additem(menu1"options 2""2"0);
        
menu_additem(menu1"options 3""3"0);                        
        
        
menu_setprop(menu1MPROP_EXITMEXIT_ALL);
        
menu_display(idmenu10);
            
}

public 
sub_menu(idmenu1item)
{    
    if( 
item == MENU_EXIT )
    {    
        
menu_destroy(menu1);
        return 
PLUGIN_HANDLED;
    }    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menu1itemaccessdata6iName63callback)
    
    new 
key str_to_num(data);
    
    switch( 
key )
    {
        case 
1:
        {
            
client_print(idprint_chat"options 1")
        }
        case 
2:
        {
            
client_print(idprint_chat"options 2")        
        }
        case 
3:
        {
            
client_print(idprint_chat"options 3")            
        }        
        
    }
    
menu_destroy(menu1);
    return 
PLUGIN_HANDLED;

I want to do when the round ends The menu will disappear
thx.
Splot is offline
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-14-2011 , 09:24   Re: Menu will disappear after the round .
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=42159
Dark Style is offline
Splot
Junior Member
Join Date: Nov 2011
Old 11-14-2011 , 10:09   Re: Menu will disappear after the round .
Reply With Quote #3

I did not understand s
Splot is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-14-2011 , 18:47   Re: Menu will disappear after the round .
Reply With Quote #4

Quote:
Originally Posted by Dark Style View Post
What does that have to do with anything lol?

@OP - I suggest using show_menu function to make a menu disappear at a point of code you want. The command is:
PHP Code:
show_menu(id0"^n"1); 
If you want it to be to everybody, id = 0.
NOTE: show_menu will close any menu the player is viewing at that moment, you can use menu_destroy to "free" the information within the menu also if you dont use it after anymore.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Splot
Junior Member
Join Date: Nov 2011
Old 11-14-2011 , 23:53   Re: Menu will disappear after the round .
Reply With Quote #5

Quote:
Originally Posted by Diegorkable View Post
What does that have to do with anything lol?

@OP - I suggest using show_menu function to make a menu disappear at a point of code you want. The command is:
PHP Code:
show_menu(id0"^n"1); 
If you want it to be to everybody, id = 0.
NOTE: show_menu will close any menu the player is viewing at that moment, you can use menu_destroy to "free" the information within the menu also if you dont use it after anymore.
working ,
Thank you so much.
Splot is offline
Reply


Thread Tools
Display Modes

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:33.


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