L L4D2node

PlayReloadSoundEffects

0x00565f70 · 332 bytes · __cdecl

_Z22PlayReloadSoundEffectsP13CTerrorPlayeriP10CTerrorGun13WeaponSound_t

Decompiled

undefined (4 params)

/* PlayReloadSoundEffects(CTerrorPlayer*, int, CTerrorGun*, WeaponSound_t) */

void PlayReloadSoundEffects
               (CBaseEntity *param_1,undefined4 param_2,CWeaponCSBase *param_3,int param_4)

{
  CBasePlayer *pCVar1;
  CBaseEntity *pCVar2;
  int iVar3;
  int iVar4;
  undefined **local_3c [11];
  
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_1);
  }
  CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
  local_3c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00565fab to 00565faf has its CatchHandler @ 005660c2 */
  CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,(Vector *)(param_1 + 0x2e0));
                    /* try { // try from 00565fba to 00566093 has its CatchHandler @ 005660d7 */
  CRecipientFilter::RemoveRecipient((CRecipientFilter *)local_3c,(CBasePlayer *)param_1);
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar4 = 1;
    do {
      while ((((pCVar1 = (CBasePlayer *)UTIL_PlayerByIndex(iVar4), param_1 == (CBaseEntity *)pCVar1
               || (pCVar1 == (CBasePlayer *)0x0)) ||
              (pCVar2 = (CBaseEntity *)(**(code **)(*(int *)pCVar1 + 0x654))(pCVar1),
              param_1 != pCVar2)) ||
             (iVar3 = (**(code **)(*(int *)pCVar1 + 0x648))(pCVar1), iVar3 != 4))) {
        iVar4 = iVar4 + 1;
        if (*(int *)(gpGlobals + 0x14) < iVar4) goto LAB_00566038;
      }
      CRecipientFilter::RemoveRecipient((CRecipientFilter *)local_3c,pCVar1);
      iVar4 = iVar4 + 1;
    } while (iVar4 <= *(int *)(gpGlobals + 0x14));
  }
LAB_00566038:
  iVar4 = CWeaponCSBase::GetCSWpnData(param_3);
  if (*(int *)(param_3 + 0x30) == 0) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(param_3 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  CBaseEntity::EmitSound
            ((IRecipientFilter *)local_3c,iVar3,(char *)(iVar4 + 0x210 + param_4 * 0x50),
             (Vector *)0x0,0.0,(float *)0x0);
  local_3c[0] = &PTR__CPASFilter_00bfaf28;
  CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
  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)