Raised This Month: $248 Target: $400
 62% 

AMXX Menu system / chooseteam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Member
Join Date: Feb 2019
Location: Latvia
Old 08-28-2020 , 10:37   AMXX Menu system / chooseteam
Reply With Quote #1

Hello.
So far i got it right, no compile errors or something else, but when i enter server and press M button it doesnt show the menu but team choose, any solutions?

PHP Code:
 #include <amxmodx>

 
public plugin_init()
 {
    
register_clcmd"chooseteam","mainmenu" );
 }
 public 
mainmenuid )
 {
    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;
 } 

Last edited by HowToRuski; 08-28-2020 at 10:37.
HowToRuski is offline
amirwolf
Senior Member
Join Date: Feb 2019
Old 08-28-2020 , 11:07   Re: AMXX Menu system / chooseteam
Reply With Quote #2

PHP Code:
 public mainmenuid )
 {
    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;
 } 
__________________

Last edited by amirwolf; 08-28-2020 at 11:09.
amirwolf is offline
HowToRuski
Member
Join Date: Feb 2019
Location: Latvia
Old 08-28-2020 , 11:13   Re: AMXX Menu system / chooseteam
Reply With Quote #3

Quote:
Originally Posted by amirwolf View Post
PHP Code:
 public mainmenuid )
 {
    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;
 } 
Well idk what it had to do with plugin_handled but seems to works. ty
HowToRuski is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-28-2020 , 14:43   Re: AMXX Menu system / chooseteam
Reply With Quote #4

You have to block the command so it doesn't display the original menu.
__________________
HamletEagle is offline
HowToRuski
Member
Join Date: Feb 2019
Location: Latvia
Old 08-28-2020 , 15:44   Re: AMXX Menu system / chooseteam
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
You have to block the command so it doesn't display the original menu.
Oh now i got it . Thanks
HowToRuski is offline
ZaKaRiAMaGh
Junior Member
Join Date: Apr 2020
Location: Morocco
Old 09-07-2020 , 13:10   Re: AMXX Menu system / chooseteam
Reply With Quote #6

Quote:
Originally Posted by HowToRuski View Post
Hello.
So far i got it right, no compile errors or something else, but when i enter server and press M button it doesnt show the menu but team choose, any solutions?
try this one

PHP Code:
#include <amxmodx>

public client_connect(id)
{                 
       
client_cmd(id,"bind m ^"chooseteam^"");        
}

 public 
plugin_init()
 {
    
register_clcmd"chooseteam","mainmenu" );
 }
 public 
mainmenuid )
 {
    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 
1;
 } 

Last edited by ZaKaRiAMaGh; 09-07-2020 at 15:39.
ZaKaRiAMaGh is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-07-2020 , 15:12   Re: AMXX Menu system / chooseteam
Reply With Quote #7

Please don't try that one because it has nothing do to with your problem and uses slowhacking which is against the rules.

PLUGIN_HANDLED blocks the original command and is the solution for your problem.
__________________

Last edited by OciXCrom; 09-07-2020 at 15:12.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 07:42.


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