Ok, I just tried again with passing the index in manually and it still didn't work.
On the mod Zombie Master, I tried this originally and it crashed whenever I shot a zombie:
Code:
SH_DECL_MANUALHOOK2(BecomeRagdoll_hook, 0, 0, 0, bool, CTakeDamageInfo const&, Vector const&);
SH_MANUALHOOK_RECONFIGURE(BecomeRagdoll_hook, idxBecomeRagdoll, 0, 0);
BecomeRagdollHook = SH_ADD_MANUALDVPHOOK(BecomeRagdoll_hook, vtblCNPC_BaseZombie, SH_STATIC(BecomeRagdoll_handler), false);
If it also interests you, I tried hooking CBasePlayer::Weapon_Equip using what you told me to do in the latest post and that also crashed whenever I shot a zombie.
EDIT: It could be a problem with sourcehook backwards compatability since I'm also using deprecated methods to hook stuff DispatchEffect.
RE-EDIT: Ok, I definitely think it's a problem with sourcehook backwards compatability. CentOS server is running MM:S 1.5. I add a plugin that uses 1.4 methods to hook ITempEntsSystem:: DispatchEffect. It crashes whenever I shoot something that uses DispatchEffect. Now I comment out the DispatchEffect hooks and reload the plugin and it doesn't crash.
YET ANOTHER EDIT: I figured out its not the hooks causing the crash, but deprecated callclasses which I think are supposed to still be backwards-compatible?
EDIT #2415: after fixing the crash and trying a lot of random stuff, I still can't get DVPHOOK to work. Does it really not need a pointer to an already existing instance?