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(PLUGIN, VERSION, AUTHOR)
for( new iBuyMenu; iBuyMenu < sizeof( g_szBuyCommands ); iBuyMenu++ )
{
register_clcmd( g_szBuyCommands[ iBuyMenu ], "@ReplaceMenu" )
}
}
@ReplaceMenu( id )
{
if( ! is_user_alive( id ) )
return PLUGIN_CONTINUE;
message_begin( MSG_ONE, get_user_msgid( "BuyClose" ), .player = id );
message_end( );
Menu_Replacement( id );
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_message( get_user_msgid("StatusIcon"), "OnMessageStatusIcon" );
public OnMessageStatusIcon( iMessage, iDestination, iEntity )
{
if (!is_user_alive( iEntity ) || get_msg_arg_int(1) != 1)
return;
static szIcon[ 10 ]
get_msg_arg_string( 2, szIcon, charsmax( szIcon ) )
if( !equal( szIcon, "buyzone" ) )
return;
set_msg_arg_int( 1, get_msg_argtype( 1 ), 0 )
}
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" ?
__________________