L L4D2node

voice_unmute

0x0005d360 · 468 bytes · __cdecl

_ZL12voice_unmuteRK8CCommand

Decompiled

undefined (1 param)

/* voice_unmute(CCommand const&) */

void voice_unmute(CCommand *param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  int iVar6;
  int in_GS_OFFSET;
  longlong lVar7;
  int local_ac;
  int local_a8;
  undefined1 local_a4 [132];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(int *)param_1 == 2) {
    iVar2 = _V_stricmp("all",*(char **)(param_1 + 0x40c));
    if (iVar2 == 0) {
      iVar6 = 1;
      puVar5 = (undefined4 *)(**(code **)(*g_pPlayerManager + 4))(g_pPlayerManager,0);
      lVar7 = (**(code **)*puVar5)(puVar5);
      iVar2 = (**(code **)(**(int **)(g_pMatchExtensions + 0x5c) + 0x54))
                        (*(int **)(g_pMatchExtensions + 0x5c));
      if (0 < iVar2) {
        do {
          cVar1 = (**(code **)(**(int **)(g_pMatchExtensions + 0x5c) + 0x20))
                            (*(int **)(g_pMatchExtensions + 0x5c),iVar6,&local_ac);
          if (((cVar1 != '\0') && (local_a8 != 0 || local_ac != 0)) &&
             (lVar7 != CONCAT44(local_a8,local_ac))) {
            (**(code **)(*(int *)g_pMatchVoice + 0x14))(g_pMatchVoice,local_ac,local_a8,0);
          }
          iVar6 = iVar6 + 1;
        } while (iVar6 <= iVar2);
      }
      Msg("All connected players have been unmuted.\n");
      goto LAB_0005d38b;
    }
    pcVar3 = "";
    if (1 < *(int *)param_1) {
      pcVar3 = *(char **)(param_1 + 0x40c);
    }
    uVar4 = V_atoi(pcVar3);
    cVar1 = (**(code **)(**(int **)(g_pMatchExtensions + 0x5c) + 0x20))
                      (*(int **)(g_pMatchExtensions + 0x5c),uVar4,&local_ac);
    if ((cVar1 != '\0') && (local_a8 != 0 || local_ac != 0)) {
      (**(code **)(*(int *)g_pMatchVoice + 0x14))(g_pMatchVoice,local_ac,local_a8,0);
      Msg("%s is now unmuted.\n",local_a4);
      goto LAB_0005d38b;
    }
    Msg("Player# is invalid or refers to a bot, please use \"voice_show_mute\" command.\n");
  }
  Msg(
     "Example usage: voice_unmute {player#|all}   -   where player# is a number that you can find with \"voice_show_mute\" command, or all to unmute all connected players.\n"
     );
LAB_0005d38b:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)