KeyValues::GetInt
0x0024dee0 · 172 bytes · __thiscall
_ZN9KeyValues6GetIntEPKci
Decompiled
undefined (3 params)
/* KeyValues::GetInt(char const*, int) */
long __thiscall KeyValues::GetInt(KeyValues *this,char *param_1,int param_2)
{
char cVar1;
int iVar2;
long lVar3;
iVar2 = FindKey(this,param_1,false);
if (iVar2 == 0) {
return param_2;
}
cVar1 = *(char *)(iVar2 + 0x10);
if (cVar1 == '\x03') {
return (int)*(float *)(iVar2 + 0xc);
}
if (cVar1 < '\x04') {
if (cVar1 == '\x01') {
lVar3 = strtol(*(char **)(iVar2 + 4),(char **)0x0,10);
return lVar3;
}
}
else {
if (cVar1 == '\x05') {
lVar3 = wcstol(*(wchar_t **)(iVar2 + 8),(wchar_t **)0x0,10);
return lVar3;
}
if (cVar1 == '\a') {
return 0;
}
}
return *(long *)(iVar2 + 0xc);
}
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.