View Single Post
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 05-15-2021 , 15:00   Re: [ANY] Input Hooks - DevTools (1.5) [03-Mar-2021]
Reply With Quote #18

Quote:
Originally Posted by Silvers View Post
How can it be done in this plugin? How do I determine if I should be reading an int or string etc? When calling DHookGetParamObjectPtrVar for an int the server will crash if it's supposed to be a string.
Hi sorry I am not well versed in dhooks, I just tried using it last week.

But you could try this: I don't know if the offset should be divided by sizeof(int).

int fieldtype = DHookGetParamObjectPtrVar(hParams, 4, offset_of_fieldType, ObjectValueType_Int),

then check if fieldtype == FIELD_STRING or FIELD_INTEGER or some other type here:

https://github.com/ValveSoftware/sou.../datamap.h#L28
__________________
bottiger is offline