rehlds / ReAPI

AMXModX module providing APIs for ReHLDS, ReGameDLL, and Metamod plugins (e.g., ReUnion, ReVoice).
GNU General Public License v3.0
160 stars 105 forks source link

ShowVGUIMenu not working as expected ? #72

Closed justgo97 closed 7 years ago

justgo97 commented 7 years ago

Both codes not working, using lastest reapi

1# :

#include <amxmodx>
#include <reapi>

public plugin_init()
{
    RegisterHookChain(RG_ShowVGUIMenu, "ShowVGUIMenu", false);
    RegisterHookChain(RG_ShowVGUIMenu, "ShowVGUIMenu_Post", true);
}

public ShowVGUIMenu(const iIndex, const VGUIMenu:iMenuType)
{
    if(iMenuType == VGUI_Menu_Buy)
    {
        set_member_game(m_bSkipShowMenu,true)
    }
    return HC_CONTINUE;
}

public ShowVGUIMenu_Post(const iIndex, const VGUIMenu:iMenuType)    
{
    set_member_game(m_bSkipShowMenu,false)
}

2#:

#include <amxmodx>
#include <reapi>

public plugin_init()
{
    RegisterHookChain(RG_ShowVGUIMenu, "ShowVGUIMenu", false);
}

public ShowVGUIMenu(const iIndex, const VGUIMenu:iMenuType)
{
    if(iMenuType == VGUI_Menu_Buy)
    {
        return HC_SUPERCEDE
    }
    return HC_CONTINUE;
}
WPMGPRoSToTeMa commented 7 years ago

How did you check that?

justgo97 commented 7 years ago

i join game and press B and weapons menu shows up.


is it client side stuff and can't be blocked ?

WPMGPRoSToTeMa commented 7 years ago

is it client side stuff and can't be blocked ?

Yeah, but you can send BuyClose usermsg to hide it.

justgo97 commented 7 years ago

ok ty