L L4D2node

Script_EmitSoundOnClient

0x00b448c0 · 222 bytes · __cdecl

_ZL24Script_EmitSoundOnClientPKcP9HSCRIPT__

Decompiled

undefined (2 params)

/* Script_EmitSoundOnClient(char const*, HSCRIPT__*) */

void Script_EmitSoundOnClient(char *param_1,HSCRIPT__ *param_2)

{
  code *pcVar1;
  char cVar2;
  ScriptClassDesc_t *pSVar3;
  CBasePlayer *pCVar4;
  int iVar5;
  CBasePlayer *pCVar6;
  undefined **local_3c [11];
  
  if (param_2 != (HSCRIPT__ *)0x0) {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar3 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
    pCVar4 = (CBasePlayer *)(*pcVar1)(g_pScriptVM,param_2,pSVar3);
    if (pCVar4 != (CBasePlayer *)0x0) {
      cVar2 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4);
      if (cVar2 != '\0') {
        cVar2 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4);
        pCVar6 = (CBasePlayer *)0x0;
        if (cVar2 != '\0') {
          pCVar6 = pCVar4;
        }
        CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
        local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 00b44940 to 00b44944 has its CatchHandler @ 00b449a4 */
        CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,pCVar6);
        if (*(int *)(pCVar4 + 0x30) == 0) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
                    /* try { // try from 00b4497e to 00b44982 has its CatchHandler @ 00b449b6 */
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar5,param_1,(Vector *)0x0,0.0,(float *)0x0);
        local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
        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)