L L4D2node

CTerrorPlayer::OnAmmoPickedUp

0x009a0a80 · 238 bytes · __thiscall

_ZN13CTerrorPlayer14OnAmmoPickedUpEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnAmmoPickedUp() */

void __thiscall CTerrorPlayer::OnAmmoPickedUp(CTerrorPlayer *this)

{
  code *pcVar1;
  int *piVar2;
  undefined4 uVar3;
  CAI_Concept local_24 [20];
  
  pcVar1 = *(code **)(*(int *)this + 0x7b4);
  CAI_Concept::CAI_Concept(local_24,"PlayerPickup");
  (*pcVar1)(this,local_24,3,"ItemPickedUp:Ammo",0,0,0);
  CBaseEntity::EmitSound((CBaseEntity *)this,"BaseCombatCharacter.AmmoPickup",0.0,(float *)0x0);
  piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"ammo_pickup",0,0);
  if (piVar2 != (int *)0x0) {
    pcVar1 = *(code **)(*piVar2 + 0x30);
    uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
    (*pcVar1)(piVar2,"userid",uVar3);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
  }
  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)