L L4D2node

CCSPlayer::KickBack

0x0043aa50 · 317 bytes · __thiscall

_ZN9CCSPlayer8KickBackEffffffi

Decompiled

undefined (8 params)

/* CCSPlayer::KickBack(float, float, float, float, float, float, int) */

void __thiscall
CCSPlayer::KickBack(CCSPlayer *this,float param_1,float param_2,float param_3,float param_4,
                   float param_5,float param_6,int param_7)

{
  CBaseEdict *this_00;
  float *pfVar1;
  int iVar2;
  int iVar3;
  float fVar4;
  float local_18;
  float local_14;
  float local_10;
  
  if (*(int *)(this + 0x2850) != 1) {
    fVar4 = (float)*(int *)(this + 0x2850);
    param_1 = param_3 * fVar4 + param_1;
    param_2 = fVar4 * param_4 + param_2;
  }
  pfVar1 = (float *)CBasePlayer::GetPunchAngle((CBasePlayer *)this);
  local_10 = pfVar1[2];
  local_18 = *pfVar1 - param_1;
  if (*pfVar1 - param_1 <= -param_5) {
    local_18 = -param_5;
  }
  if (*(int *)(this + 0x284c) == 1) {
    local_14 = param_2 + pfVar1[1];
    if (param_6 <= local_14) {
      local_14 = param_6;
    }
  }
  else {
    local_14 = pfVar1[1] - param_2;
    if (local_14 <= -param_6) {
      local_14 = -param_6;
    }
  }
  iVar2 = SharedRandomInt("KickBack",0,param_7,0);
  if (iVar2 == 0) {
    iVar2 = *(int *)(this + 0x284c);
    if (this[0x6c] == (CCSPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
      *(int *)(this + 0x284c) = 1 - iVar2;
    }
    else {
      this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
      *(int *)(this + 0x284c) = 1 - iVar2;
    }
  }
  CBasePlayer::SetPunchAngle((CBasePlayer *)this,(QAngle *)&local_18);
  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)