CPainPills::CanUseOnSelf
0x00552600 · 203 bytes · __thiscall
_ZN10CPainPills12CanUseOnSelfEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* CPainPills::CanUseOnSelf(CTerrorPlayer*) */
undefined4 __thiscall CPainPills::CanUseOnSelf(CPainPills *this,CTerrorPlayer *param_1)
{
int iVar1;
code *pcVar2;
int *piVar3;
undefined4 uVar4;
longdouble lVar5;
uVar4 = 1;
iVar1 = *(int *)(param_1 + 0x100);
lVar5 = (longdouble)(**(code **)(*(int *)param_1 + 0x7e4))(param_1);
if (*(float *)(PainPillsHealthThreshold._28_4_ + 0x2c) <= (float)lVar5 + (float)iVar1 &&
(float)lVar5 + (float)iVar1 != *(float *)(PainPillsHealthThreshold._28_4_ + 0x2c)) {
uVar4 = 0;
piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"pills_used_fail",0,0);
if (piVar3 != (int *)0x0) {
pcVar2 = *(code **)(*piVar3 + 0x30);
uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
(*pcVar2)(piVar3,"userid",uVar4);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
return 0;
}
}
return uVar4;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.