reapi
reapi copied to clipboard
RG_CBasePlayer_GiveNamedItem cannot be hooked
As I can see none of this events (pre or post) can be hooked. Anyone else experienced this?
I mean won't be tiggered on GiveNamedItem calls.
Because game often uses "CBasePlayer::GiveNamedItemEx" instead. Resulting original "GiveNamedItem" not called as much as you expected. But it is still called in some buy events.
Because game often uses "CBasePlayer::GiveNamedItemEx" instead. Resulting original "GiveNamedItem" not called as much as you expected. But it is still called in some buy events.
I expected to work with rg_give_item native call. Should not work with that?
This native uses "GiveNamedItemEx" too, that's why, and yes, it is annoying. Best on my opinion will be to improve original "GiveNamedItem" & remove the extended one, so all GiveNamedItems calls point to an unique function, and the hook catch it. But maybe devs wanted to have this separated at the beginning (to differenciate original game calls from API's one), but some parts of the game were later updated to use the extended version, so this is confusing & a little mess with both.
Since we don't know what they want to do in the future. Maybe implementing a RG_CBasePlayer_GiveNamedItemEx hook should be the best option to keep it separated from the original. What do you think @StevenKal ? Can we make it and put in into a merge request? For my own purpose I will definitely code it (if possibble). I just want to know your opinion... Should we tag someone from the active developers to make the decision?
Sorry I do not work for that "AMXX" thing, or except for money at worst. I know this reapi here is for it, I just take a ride to it sometimes because I follow it, but not more. Adding a PR to both ReGameDLL_CS & this ReAPI is feasible, but gonna be dormant for months... I can add the hook to both binaries (like, make a version for you), for a few euros, or, you can use module like Orpheu to memhack the GiveNamedItemEx.
cuz https://github.com/s1lentq/ReGameDLL_CS/pull/470 ?