AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu will disappear after the round . (https://forums.alliedmods.net/showthread.php?t=172049)

Splot 11-14-2011 09:10

Menu will disappear after the round .
 
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.

Dark Style 11-14-2011 09:24

Re: Menu will disappear after the round .
 
http://forums.alliedmods.net/showthread.php?t=42159

Splot 11-14-2011 10:09

Re: Menu will disappear after the round .
 
I did not understand s

Diegorkable 11-14-2011 18:47

Re: Menu will disappear after the round .
 
Quote:

Originally Posted by Dark Style (Post 1596505)

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.

Splot 11-14-2011 23:53

Re: Menu will disappear after the round .
 
Quote:

Originally Posted by Diegorkable (Post 1596638)
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.


All times are GMT -4. The time now is 08:33.

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