View Single Post
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-28-2011 , 01:17   Re: hook/replace buy menu in cs 1.6
Reply With Quote #3

I see, btw the code of the plugin that I linked to in the first post gives the possibility to override the submenus of the vgui buy menu (if modified a little bit), so I think there should be a way to override the main buy menu as well. I managed to replace the vgui team/class selection menu with my own, only if I knew how to do the same with the main buy menu...

So I was thinking, I used this method for the vgui team select menu
PHP Code:
public plugin_init()
{
    
register_message(get_user_msgid("VGUIMenu"), "message_VGUIMenu");
}

public 
message_VGUIMenu(iMsgidiDestid)
{
    if(
get_msg_arg_int(1) != VGUI_JOIN_TEAM_NUM)
    {
        return 
PLUGIN_CONTINUE;
    }

    
//block message, show new menu, after selection finished - unblock message

, and it works perfectly, but I don't know where that VGUI_JOIN_TEAM_NUM is defined, and I suspect that there should be a define for the buymenu as well...
If you haven't looked at the code of the plugin in the first post, it has
PHP Code:
    //VGUI Menus
    
register_menucmd(-29,keys,"hook_menu1"//buy pistols
    
register_menucmd(-30,keys,"hook_menu2"//buy shotguns
    
register_menucmd(-32,keys,"hook_menu3"//buy smgs
    
register_menucmd(-31,keys,"hook_menu4"//buy rifles
    
register_menucmd(-33,keys,"hook_menu5"//buy machine gun 
so there should be an offset for the main buymenu as well, I hope. If anyone know how to get it to work with either of these 2 ways or a new way, please share it
__________________

Last edited by SeriousSam; 04-28-2011 at 01:40.
SeriousSam is offline
Send a message via Skype™ to SeriousSam