CBasePlayer::HasNamedPlayerItem
0x007b3430 · 179 bytes · __thiscall
_ZN11CBasePlayer18HasNamedPlayerItemEPKc
Decompiled
undefined (2 params)
/* CBasePlayer::HasNamedPlayerItem(char const*) */
undefined4 __thiscall CBasePlayer::HasNamedPlayerItem(CBasePlayer *this,char *param_1)
{
uint uVar1;
char *pcVar2;
int iVar3;
undefined4 *puVar4;
uint uVar5;
CBasePlayer *pCVar6;
int iVar7;
iVar7 = 0;
pCVar6 = this + 0x18f4;
do {
uVar1 = *(uint *)pCVar6;
if (uVar1 != 0xffffffff) {
uVar5 = uVar1 & 0xfff;
puVar4 = (undefined4 *)(g_pEntityList + uVar5 * 0x10 + 4);
if (((puVar4 != (undefined4 *)0x0) &&
(*(uint *)(g_pEntityList + uVar5 * 0x10 + 8) == uVar1 >> 0xc)) &&
(*(int *)(g_pEntityList + uVar5 * 0x10 + 4) != 0)) {
pcVar2 = *(char **)(*(int *)(g_pEntityList + uVar5 * 0x10 + 4) + 0x7c);
if (pcVar2 == (char *)0x0) {
pcVar2 = "";
}
if (param_1 == pcVar2) {
LAB_007b34e0:
return *puVar4;
}
iVar3 = _V_stricmp(param_1,pcVar2);
if (iVar3 == 0) {
uVar1 = *(uint *)pCVar6;
if (uVar1 == 0xffffffff) {
return 0;
}
puVar4 = (undefined4 *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4);
if (puVar4 == (undefined4 *)0x0) {
return 0;
}
if (puVar4[1] != uVar1 >> 0xc) {
return 0;
}
goto LAB_007b34e0;
}
}
}
iVar7 = iVar7 + 1;
pCVar6 = pCVar6 + 4;
if (iVar7 == 0x38) {
return 0;
}
} while( true );
}
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.