L L4D2node

Music::SendCommand

0x008f4b10 · 325 bytes · __thiscall

_ZN5Music11SendCommandEPKcS1_S1_i

Decompiled

undefined (5 params)

/* Music::SendCommand(char const*, char const*, char const*, int) */

void __thiscall
Music::SendCommand(Music *this,char *param_1,char *param_2,char *param_3,int param_4)

{
  char cVar1;
  CBasePlayer *this_00;
  int iVar2;
  char local_4c;
  CRecipientFilter local_3c [44];
  
  if (*(int *)(MusicManagerOn._28_4_ + 0x30) != 0) {
    if (*(int *)(*(int *)(this + 0x378) + 0x30) == 0) {
      local_4c = '\0';
    }
    else {
      local_4c = (char)((uint)(*(int *)(*(int *)(this + 0x378) + 0x30) - *(int *)(gpGlobals + 0x58))
                       >> 4);
    }
    CRecipientFilter::CRecipientFilter(local_3c);
    if (0 < *(int *)(gpGlobals + 0x14)) {
      iVar2 = 1;
LAB_008f4b7d:
      do {
                    /* try { // try from 008f4b80 to 008f4c40 has its CatchHandler @ 008f4c5b */
        this_00 = (CBasePlayer *)UTIL_PlayerByIndex(iVar2);
        if (this_00 != (CBasePlayer *)0x0) {
          cVar1 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
          if (cVar1 != '\0') {
            cVar1 = CBasePlayer::IsSplitScreenPlayer(this_00);
            if (cVar1 == '\0') {
              CRecipientFilter::AddRecipient(local_3c,this_00);
              iVar2 = iVar2 + 1;
              if (*(int *)(gpGlobals + 0x14) < iVar2) break;
              goto LAB_008f4b7d;
            }
          }
        }
        iVar2 = iVar2 + 1;
      } while (iVar2 <= *(int *)(gpGlobals + 0x14));
    }
    CRecipientFilter::MakeReliable(local_3c);
    UserMessageBegin((IRecipientFilter *)local_3c,"MusicCmd");
    MessageWriteUBitLong(4,3);
    MessageWriteUBitLong((int)local_4c,*(int *)(this + 0x37c));
    MessageWriteString(param_1);
    MessageWriteString(param_2);
    MessageWriteString(param_3);
    MessageWriteUBitLong(param_4 + 1,0xb);
    MessageEnd();
    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)