L L4D2node

CBasePlayer::CommitSuicide

0x007a99d0 · 281 bytes · __thiscall

_ZN11CBasePlayer13CommitSuicideEbb

Decompiled

undefined (3 params)

/* CBasePlayer::CommitSuicide(bool, bool) */

void __thiscall CBasePlayer::CommitSuicide(CBasePlayer *this,bool param_1,bool param_2)

{
  code *pcVar1;
  int *piVar2;
  char cVar3;
  CTakeDamageInfo local_7c [108];
  
  piVar2 = mdlcache;
  (**(code **)(*mdlcache + 0x68))(mdlcache);
                    /* try { // try from 007a99fb to 007a9a00 has its CatchHandler @ 007a9af4 */
  cVar3 = (**(code **)(*(int *)this + 300))(this);
  if ((cVar3 != '\0') && ((*(float *)(this + 0x1da8) <= *(float *)(gpGlobals + 0xc) || (param_2))))
  {
    *(float *)(this + 0x1da8) = *(float *)(gpGlobals + 0xc) + 5.0;
    if (*(int *)(this + 0x100) != 0) {
                    /* try { // try from 007a9adf to 007a9ae4 has its CatchHandler @ 007a9af4 */
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(undefined4 *)(this + 0x100) = 0;
    }
    pcVar1 = *(code **)(*(int *)this + 0x130);
                    /* try { // try from 007a9a93 to 007a9aae has its CatchHandler @ 007a9af4 */
    CTakeDamageInfo::CTakeDamageInfo
              (local_7c,(CBaseEntity *)this,(CBaseEntity *)this,0.0,
               (-(uint)!param_1 & 0xffffefc0) + 0x2840,*(int *)(this + 0x1dac));
    (*pcVar1)(this,local_7c);
    (**(code **)(*(int *)this + 0x4d8))(this);
    *(undefined4 *)(this + 0x1dac) = 0;
    (**(code **)(*piVar2 + 0x6c))(piVar2);
    return;
  }
  (**(code **)(*piVar2 + 0x6c))(piVar2);
  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)