L L4D2node

CBasePlayer::DamageEffect

0x007a8660 · 404 bytes · __thiscall

_ZN11CBasePlayer12DamageEffectEfi

Decompiled

undefined (3 params)

/* CBasePlayer::DamageEffect(float, int) */

void __thiscall CBasePlayer::DamageEffect(CBasePlayer *this,float param_1,int param_2)

{
  undefined4 uVar1;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  if ((param_2 & 1U) == 0) {
    if ((param_2 & 0x4000U) == 0) {
      if ((param_2 & 4U) != 0) {
        uVar1 = (**(code **)(*(int *)this + 0x138))(this);
        (**(code **)(*(int *)this + 0x234))(&local_18,this);
        SpawnBlood(local_18,local_14,local_10,&g_vecAttackDir,uVar1,param_1);
        return;
      }
      if ((param_2 & 0x1000000U) == 0) {
        if ((param_2 & 0x200U) == 0) {
          if ((param_2 & 2U) != 0) {
            CBaseEntity::EmitSound((CBaseEntity *)this,"Flesh.BulletImpact",0.0,(float *)0x0);
            return;
          }
        }
        else {
          CBaseEntity::EmitSound((CBaseEntity *)this,"Player.SonicDamage",0.0,(float *)0x0);
        }
        return;
      }
      local_18 = 0x64ff0000;
      UTIL_ScreenFade((CBaseEntity *)this,(color32_s *)&local_18,0.2,0.4,4);
      CBaseEntity::EmitSound((CBaseEntity *)this,"Player.PlasmaDamage",0.0,(float *)0x0);
      return;
    }
    local_18._0_3_ = 0x800000;
  }
  else {
    local_18._0_3_ = 0x80;
  }
  local_18 = CONCAT13(0x80,(undefined3)local_18);
  UTIL_ScreenFade((CBaseEntity *)this,(color32_s *)&local_18,1.0,0.1,1);
  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)