L L4D2node

Script_SetFakeClientConVarValue

0x00b44680 · 165 bytes · __cdecl

_ZL31Script_SetFakeClientConVarValueP9HSCRIPT__PKcS2_

Decompiled

undefined (3 params)

/* Script_SetFakeClientConVarValue(HSCRIPT__*, char const*, char const*) */

void Script_SetFakeClientConVarValue(HSCRIPT__ *param_1,char *param_2,char *param_3)

{
  code *pcVar1;
  char cVar2;
  ScriptClassDesc_t *pSVar3;
  int iVar4;
  int *piVar5;
  
  if (param_1 != (HSCRIPT__ *)0x0) {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar3 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
    iVar4 = (*pcVar1)(g_pScriptVM,param_1,pSVar3);
    if (iVar4 != 0) {
      piVar5 = (int *)__dynamic_cast(iVar4,&CBaseEntity::typeinfo,&CBasePlayer::typeinfo,0);
      if (piVar5 != (int *)0x0) {
        cVar2 = (**(code **)(*piVar5 + 0x5a8))(piVar5);
        if ((cVar2 != '\0') && (piVar5[0xc] != 0)) {
          (**(code **)(*engine + 0x15c))(engine,piVar5[0xc],param_2,param_3);
        }
      }
    }
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)