Quote:
Originally Posted by K.K.Lv
how to get the offset of the object ?
code from your tut about DHooks:
Code:
public MRESReturn:OnTakeDamage(this, Handle:hReturn, Handle:hParams)
{
PrintToServer("DHooksHacks = Victim %i, Attacker %i, Inflictor %i, Damage %f", this, DHookGetParamObjectPtrVar(hParams, 1, 40, ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float));
if(this <= MaxClients && this > 0 && !IsFakeClient(this))
{
DHookSetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float, 0.0);
PrintToChat(this, "Pimping your hp");
}
}
|
Its math, the class for CTakeDamageInfo is in the sdk so its easier
https://mxr.alliedmods.net/hl2sdk-cs...mageinfo.h#112
The size of a vector is 16 EHANDLE is 4 and float is 4 So the values start from 0.
Vector m_vecDamageForce; //0
Vector m_vecDamagePosition; //12
Vector m_vecReportedPosition; //24
EHANDLE m_hInflictor; //36
EHANDLE m_hAttacker; //40
EHANDLE m_hWeapon; //44
float m_flDamage; //48
float m_flMaxDamage; //52
float m_flBaseDamage; //56
int m_bitsDamageType; //60
int m_iDamageCustom; //64
int m_iDamageStats; //68
int m_iAmmoType; //72
int m_iDamagedOtherPlayers; //76
int m_iPlayerPenetrateCount; //80