SV_CheatsChanged_f
0x001fb6f0 · 215 bytes · __cdecl
_ZL18SV_CheatsChanged_fP7IConVarPKcf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SV_CheatsChanged_f(IConVar*, char const*, float) */
void SV_CheatsChanged_f(IConVar *param_1,char *param_2,float param_3)
{
bool bVar1;
char cVar2;
int iVar3;
int *local_14;
int local_10;
ConVarRef::ConVarRef((ConVarRef *)&local_14,param_1);
if (*(int *)(local_10 + 0x30) == 0) {
if (param_3 != 0.0) {
(**(code **)(*g_pCVar + 0x60))(g_pCVar,0x4000);
DevMsg("FCVAR_CHEAT cvars reverted to defaults.\n");
}
return;
}
if (param_3 != 0.0) {
return;
}
cVar2 = ConVar::IsFlagSet((ConVar *)sv_hosting_lobby,2);
if (cVar2 == '\0') {
return;
}
if ((g_pMatchFramework == (int *)0x0) ||
(iVar3 = (**(code **)(*g_pMatchFramework + 0x24))(g_pMatchFramework), iVar3 == 0)) {
bVar1 = true;
}
else {
bVar1 = false;
}
if (((DAT_003b80d0 == 0 && _DAT_003b80cc == 0) && (*(int *)(sv_hosting_lobby._28_4_ + 0x30) == 0))
&& (bVar1)) {
return;
}
(**(code **)(*local_14 + 8))(local_14,0);
Msg(
"Can\'t use cheats now; please exit to main menu and start your own listen server with \"map mapname\" so that you could enable cheats.\n"
);
return;
}
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.