s1lentq / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
161 stars 103 forks source link

RG_ShowVGUIMenu doesn't work with the buys menu #48

Closed ivanmaxlogiudice closed 7 years ago

ivanmaxlogiudice commented 7 years ago

The only one who works is VGUI_Menu_Buy_Item with the command "buyequip"

#include <amxmodx>
#include <reapi>

public plugin_init()
    RegisterHookChain(RG_ShowVGUIMenu, "fw_ShowVGUIMenu");

public fw_ShowVGUIMenu( const iPlayerID, VGUIMenu: iMenu, const iBitsSlots, const szOldMenu[], const bool: bForceOldMenu )
{
    client_print_color(iPlayerID, iPlayerID, "iMenu: %d | iBitsSlots: %d | szOldMenu: %s | bForceOldMenu: %d", iMenu, iBitsSlots, szOldMenu, bForceOldMenu)
}

IMG: http://imgur.com/a/ZsNeA

OS Centos 6.8 final ReHLDS version: 3.0.0.414-dev Bugfix ReGameDLL version: 5.2.0.176-dev ReAPI 5.1.0.103-dev

ivanmaxlogiudice commented 7 years ago

@s1lentq @theAsmodai

WPMGPRoSToTeMa commented 7 years ago

Do you mean old menu or vgui?

ivanmaxlogiudice commented 7 years ago

With old menu works fine, but with vgui doesn't

WPMGPRoSToTeMa commented 7 years ago

You can't hook that because vgui buymenu is directly opened on the client-side. But when it is opened the client sends client_buy_open command to the server. So we need to think: should we call that hook when server receives client_buy_open from the client.

ivanmaxlogiudice commented 7 years ago

I did not know it was like this... Ty