View Single Post
Author Message
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 03-21-2018 , 15:26   CBasePlayerItem help
Reply With Quote #1

Working on a Metamod plugin, I am hooking AddPlayerItem in the same way Hamsandwich does.
The function takes three arguments as below

Code:
BOOL __fastcall HookAddPlayerItem(void *pthis, int i, CBasePlayerItem *pItem)
Hooking works fine and I am able to call the original function successfully from within the hook, but I do not know how to retrieve information of pItem (ie Weapon ID, classname, etc).

I have attempted to include HLTypeConversion.h and use cbase_to_int but the returned integer does not make sense, while cbase_to_edict returns the edict pointer but I am unable to retrieve any PvPrivateData, server crashes .

Any help is appreciated.
vitorrossi is offline