L L4D2node

CTerrorPlayer::ScriptGiveNamedItemWithSkin

0x009e55d0 · 216 bytes · __thiscall

_ZN13CTerrorPlayer27ScriptGiveNamedItemWithSkinEPKci

Decompiled

undefined (3 params)

/* CTerrorPlayer::ScriptGiveNamedItemWithSkin(char const*, int) */

void __thiscall
CTerrorPlayer::ScriptGiveNamedItemWithSkin(CTerrorPlayer *this,char *param_1,int param_2)

{
  CBaseEdict *this_00;
  int *piVar1;
  int iVar2;
  int iVar3;
  
  piVar1 = (int *)(**(code **)(*(int *)this + 0x6c0))(this,param_1,0,1,0);
  if ((piVar1 != (int *)0x0) && (-1 < param_2)) {
    iVar2 = (**(code **)(*piVar1 + 0xf0))(piVar1);
    if (iVar2 != 0) {
      iVar2 = (**(code **)(*piVar1 + 0xf0))(piVar1);
      if (*(int *)(iVar2 + 0x458) != param_2) {
        if (*(char *)(iVar2 + 0x6c) == '\0') {
          this_00 = *(CBaseEdict **)(iVar2 + 0x30);
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar3 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar3 + 2) = 0;
          }
        }
        else {
          *(byte *)(iVar2 + 0x70) = *(byte *)(iVar2 + 0x70) | 1;
        }
        *(int *)(iVar2 + 0x458) = param_2;
      }
      piVar1 = (int *)__dynamic_cast(piVar1,&CBaseEntity::typeinfo,&CBaseCombatWeapon::typeinfo,0);
      if (piVar1 != (int *)0x0) {
                    /* WARNING: Could not recover jumptable at 0x009e56a9. Too many branches */
                    /* WARNING: Treating indirect jump as call */
        (**(code **)(*piVar1 + 0x3fc))();
        return;
      }
    }
  }
  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)