Raised This Month: $12 Target: $400
 3% 

How to create custom menu for the "B" button !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-03-2022 , 13:45   How to create custom menu for the "B" button !
Reply With Quote #1

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" ?
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 03-03-2022 , 13:58   Re: How to create custom menu for the "B" button !
Reply With Quote #2

Take a look here: https://github.com/TheDoctor0/CSGOMo...go_buymenu.sma
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-09-2022 , 02:10   Re: How to create custom menu for the "B" button !
Reply With Quote #3

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
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache 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 07:35.


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