View Single Post
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 11-06-2008 , 14:07   Re: Using SourceHook
Reply With Quote #21

Im now trying to hook
the WeaponCanUse virtual function

SH_DECL_MANUALHOOK1(WeaponCanUseHook, 0, 0, 0, bool, CBaseCombatWeapon *);
declared globally

i added into clientactive:

int Offset=216;
SH_MANUALHOOK_RECONFIGURE(WeaponCanUseHook, Offset, 0, 0);
SH_ADD_MANUALHOOK_MEMFUNC(WeaponCanUseHook, pBase, &g_EmtpyServerPlugin, &CEmptyServerPlugin::WeaponCanUseFunction, false);

and have:
bool CEmptyServerPlugin::WeaponCanUseFunction(CBas eCombatWeapon *pWeapon)
{
RETURN_META_VALUE(MRES_IGNORED, false);
}

and it appears to hook etc...but when the WeaponCanUseFunction is called
it comes up with and ESP problem with parameters not being stored correctly across the function call and Dont know what Im doing wrong.
I want to hook if someone can use a specific weapon .
What am I doing incorrectly?
__________________
CSource Server:
69.90.34.10:27015 Beetlesmod.com And CS-Addicts{US}



http://www.clanuseast.com
BeetleFart is offline