AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to create custom menu for the "B" button ! (https://forums.alliedmods.net/showthread.php?t=336618)

Supremache 03-03-2022 13:45

How to create custom menu for the "B" button !
 
I was looking for how to do it and found these methods:

This method works but shows the original "buy menu" for 1-3 seconds when using "VGUI Menu":
PHP Code:

new const g_szBuyCommands[ ][ ]=
{
        
"usp""deagle""m3""galil""defender""ak47""cv47""scout""sg552""krieg552""awp""magnum""g3sg1""d3au1""famas""clarion"
        
"m4a1""aug""bullpup""krieg550""glock""9x19mm""km45""p228""228compact""nighthawk""elites""fn57""fiveseven""12gauge"
        
"xm1014""autoshotgun""mac10""tmp""mp""mp5""smg""ump45""p90""c90""m249""vest""vesthelm""flash""hegren""sgren"
        
"nvgs""shield""cl_setautobuy""cl_autobuy""cl_setrebuy""cl_rebuy""buyequip""buy""client_buy_open"
}

public 
plugin_init( ) 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    for( new 
iBuyMenuiBuyMenu sizeofg_szBuyCommands ); iBuyMenu++ )
    {
        
register_clcmd(    g_szBuyCommandsiBuyMenu ], "@ReplaceMenu" )
    }
}

@
ReplaceMenuid )
{
    if( ! 
is_user_aliveid ) )
        return 
PLUGIN_CONTINUE;
    
    
message_beginMSG_ONEget_user_msgid"BuyClose" ), .player id );
    
message_end( );
    
    
Menu_Replacementid );
        
    return 
PLUGIN_HANDLED;


In this method button "B" is blocked when using "VGUI Menu" so it is not possible to create custom menu for this button if used this method:
PHP Code:

register_messageget_user_msgid("StatusIcon"), "OnMessageStatusIcon" );

public 
OnMessageStatusIconiMessageiDestinationiEntity )
{
    if (!
is_user_aliveiEntity ) || get_msg_arg_int(1) != 1)
        return;
    
    static 
szIcon10 ]
    
get_msg_arg_string2szIconcharsmaxszIcon ) )
    
    if( !
equalszIcon"buyzone" ) )
        return;

    
set_msg_arg_int1get_msg_argtype), )


My question: Is there a way that allows me to create a custom menu for the "B" button without showing the original buy menu while using "Old menu style" or "VGUI menu" ?

Shadows Adi 03-03-2022 13:58

Re: How to create custom menu for the "B" button !
 
Take a look here: https://github.com/TheDoctor0/CSGOMo...go_buymenu.sma

Supremache 03-09-2022 02:10

Re: How to create custom menu for the "B" button !
 
It is similar to the first method, when i switch the old menu style to the VGUI menu, the original menu appears for 1-3 seconds


All times are GMT -4. The time now is 10:02.

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