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