Quote:
|
Well, the problem is that it will open the menu automatically when touching the buy zone...
|
Easy fix, register a command(or even the original one - "buy") for your custom buy menu and set a bool to true here. In StatusIcon, open the menu only if this bool is true.
The buy command can be hooked with register_clcmd, but IIRC it's not enough to prevent buy. You have to pair that with buy zone removal, but this is not what you want because if you do it like that, you would have to create a custom buy zone entity in the place of original one, which after all is not that hard. Just copy the origin and stuff from the buy zone entity to your custom one.
Anyway, if you only care about VGUIMenu, you could simply hook it(
https://wiki.alliedmods.net/index.ph...ct=no#VGUIMenu) with
register_message and block the original menu, then do your stuff.
There are many solutions, choose the one that looks better for you and do some tests. I no longer have CS installed so I don't feel like writting the code.
__________________