• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Trigger] Disabling volume channels for certain players?

Status
Not open for further replies.
Level 1
Joined
Dec 24, 2014
Messages
3
[FIXED] Disabling volume channels for certain players?

Hi, I was wondering if you could mute one or more volume channels for a specific player (ex: mute music for player 1), kind of like Notrom's global silence from DotA but for the enemy team only.
 
Last edited:
Level 1
Joined
Dec 24, 2014
Messages
3
Never mind, I managed to get it to work. In case this could help anyone, here's the custom function I used.

JASS:
function MutePlayer takes player p returns nothing
    if GetLocalPlayer() == p then
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_AMBIENTSOUNDS, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_SPELLS, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_COMBAT, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_FIRE, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_MUSIC, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITMOVEMENT, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITSOUNDS, 0.00 )
    call TriggerSleepAction( ( 15.00 + ( 5.00 * I2R(GetUnitAbilityLevelSwapped('A0AF', udg_DSUnit)) ) ) )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_AMBIENTSOUNDS, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_SPELLS, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_COMBAT, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_FIRE, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_MUSIC, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITMOVEMENT, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITSOUNDS, 100.00 )
    endif
endfunction
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You need to split your function into two parts, because TriggerSleepAction inside a GetLocalPlayer block causes desync.

JASS:
function MutePlayer takes player p returns nothing
    local real time =  ( 15.00 + ( 5.00 * I2R(GetUnitAbilityLevelSwapped('A0AF', udg_DSUnit)) ) ) 
    if GetLocalPlayer() == p then
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_AMBIENTSOUNDS, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_SPELLS, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_COMBAT, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_FIRE, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_MUSIC, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITMOVEMENT, 0.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITSOUNDS, 0.00 )
    endif

    call TriggerSleepAction(time)

    if GetLocalPlayer() == p then
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_AMBIENTSOUNDS, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_SPELLS, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_COMBAT, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_FIRE, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_MUSIC, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITMOVEMENT, 100.00 )
    call VolumeGroupSetVolumeBJ( SOUND_VOLUMEGROUP_UNITSOUNDS, 100.00 )
    endif
endfunction
 
Status
Not open for further replies.
Top