Raised This Month: $ Target: $400
 0% 

[REQ] Help with Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 07-20-2014 , 15:18   [REQ] Help with Menu
Reply With Quote #1

I want this menu (for example), to appear when someone press B (buy) or M (chooseteam) key:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd"my_awesome_menu","AwesomeMenu" );
}

public 
AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
}

public 
menu_handleridmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            
client_printidprint_chat"Hooray! You selected the Awesome 1st Selection" );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        
        case 
1:
        {
            
client_printidprint_chat"OH NO! You selected the Awesome 2nd Selection! BEWARE!" );
        }
        
        case 
2:
        {
            
client_printidprint_chat"You have selected the Awesome Admin Selection! Hail Teh Bail!" );
        }
        
        case 
MENU_EXIT:
        {
            
client_printidprint_chat"You exited the menu... what a bummer!" );
        }
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

i've tried:

PHP Code:
register_clcmd"buy","AwesomeMenu" )
register_clcmd"chooseteam","AwesomeMenu" 
but it keeps showing the buy menu and the chooseteam menu, any solutions or after the valve update is no longer possible?

thanks in advance
demon81 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-20-2014 , 15:28   Re: [REQ] Help with Menu
Reply With Quote #2

put the plugin first in plugins.ini
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 07-20-2014 , 15:34   Re: [REQ] Help with Menu
Reply With Quote #3

Quote:
Originally Posted by Fuck For Fun View Post
put the plugin first in plugins.ini
For what?

#edit: oh, in the 1st place in plugins.ini?
#edit2: the same, keeps showing the buy menu and the chooseteam menu

Last edited by demon81; 07-20-2014 at 15:39. Reason: misunderstood
demon81 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-20-2014 , 15:55   Re: [REQ] Help with Menu
Reply With Quote #4

You HAVE to return PLUGIN_HANDLED when you register it with client_cmd "chooseteam". And you may put it first in plugins.ini
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 07-20-2014 , 18:09   Re: [REQ] Help with Menu
Reply With Quote #5

Quote:
Originally Posted by Flick3rR View Post
You HAVE to return PLUGIN_HANDLED when you register it with client_cmd "chooseteam". And you may put it first in plugins.ini
It worked, but the B key (buy) don't work, and the chooseteam menu still appears. is there way that i can remove the chooseteam menu and the buy menu?
demon81 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-21-2014 , 08:03   Re: [REQ] Help with Menu
Reply With Quote #6

Quote:
Originally Posted by demon81 View Post
It worked, but the B key (buy) don't work, and the chooseteam menu still appears. is there way that i can remove the chooseteam menu and the buy menu?
Show us your code.

Last edited by HamletEagle; 07-21-2014 at 08:03.
HamletEagle is offline
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 07-21-2014 , 14:32   Re: [REQ] Help with Menu
Reply With Quote #7

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd"my_awesome_menu","AwesomeMenu" );
    
register_clcmd"buy","AwesomeMenu" );
    
register_clcmd"chooseteam","AwesomeMenu" );

    return 
PLUGIN_HANDLED
}

public 
AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
}

public 
menu_handleridmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            
client_printidprint_chat"Hooray! You selected the Awesome 1st Selection" );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        
        case 
1:
        {
            
client_printidprint_chat"OH NO! You selected the Awesome 2nd Selection! BEWARE!" );
        }
        
        case 
2:
        {
            
client_printidprint_chat"You have selected the Awesome Admin Selection! Hail Teh Bail!" );
        }
        
        case 
MENU_EXIT:
        {
            
client_printidprint_chat"You exited the menu... what a bummer!" );
        }
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

I've been using this one till it shows up when i press both 'm' and 'b'

and when i press 'm' in this plugin above, nothing happens when i choose one of the three cases. it only works when the "chooseteam" menu don't appear (after i choose one team and wait to round restart)

Last edited by demon81; 07-21-2014 at 14:35.
demon81 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 07-21-2014 , 14:34   Re: [REQ] Help with Menu
Reply With Quote #8

PHP Code:
public AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);


PHP Code:
public AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    return 
PLUGIN_HANDLED;

__________________
Hey ^_^
NikKOo31 is offline
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 07-21-2014 , 14:40   Re: [REQ] Help with Menu
Reply With Quote #9

Quote:
Originally Posted by NikKOo31 View Post
PHP Code:
public AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);


PHP Code:
public AwesomeMenuid )
{
    new 
menu menu_create"\rLook at this awesome Menu!:""menu_handler" );
    
    
menu_additemmenu"\wI'm Selection #1""");
    
menu_additemmenu"\wI'm Selection #2""");
    
menu_additemmenu"\wI'm Secret Selection #3"""ADMIN_ADMIN );
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    return 
PLUGIN_HANDLED;

Thanks! It worked with the "chooseteam", but not with the "buy"
demon81 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 07-21-2014 , 15:40   Re: [REQ] Help with Menu
Reply With Quote #10

Quote:
Originally Posted by demon81 View Post
Thanks! It worked with the "chooseteam", but not with the "buy"
The buy menu works different.
Try this

PHP Code:
//global
new msgbuy

//plugin_init
msgbuy get_user_msgid("BuyClose")
register_clcmd("buy""player_cmd_buy_main")
register_clcmd("buyequip""player_cmd_buy_equipament")
register_clcmd("client_buy_open""player_cmd_buyVGUI")

public 
player_cmd_buy_main(id)
{
    
//your menu
    
return PLUGIN_HANDLED
}

public 
player_cmd_buy_equipament(id)
{
    
//your menu
    
return PLUGIN_HANDLED
}

public 
player_cmd_buyVGUI(id)
{
    
message_begin(MSG_ONEmsgbuy_id)
    
message_end()

    
//your menu
    
return PLUGIN_HANDLED

__________________
Hey ^_^
NikKOo31 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 09:51.


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