3717 {
3718 #ifdef SERVER
3719 return null;
3720 #endif
3722 DayZPlayerTypeVoiceSoundLookupTable table = type.GetVoiceSoundLookupTable();
3723 if (!table)
3724 return null;
3726 GameInventory inventory = GetInventory();
3729
3730 string category;
3731 if (mask || head_gear)
3732 {
3733 string category_mask;
3734 string category_headgear;
3735
3736 int priority_mask;
3737 int priority_headgear;
3738
3739 if (mask)
3740 {
3741 category_mask = mask.ConfigGetString("soundVoiceType");
3742 priority_mask = mask.ConfigGetInt("soundVoicePriority");
3743 }
3744 if (head_gear)
3745 {
3746 category_headgear = head_gear.ConfigGetString("soundVoiceType");
3747 priority_headgear = head_gear.ConfigGetInt("soundVoicePriority");
3748 }
3749
3750 if (priority_headgear >= priority_mask && category_headgear != "")
3751 {
3752 category = category_headgear;
3753 }
3754 else
3755 {
3756 category = category_mask;
3757 }
3758 }
3759
3760 if (category == "")
3761 {
3762 category = "none";
3763 }
3764
3766
3767 if (soundBuilder)
3768 {
3769 PlayerBase player = PlayerBase.Cast(this);
3770
3771 int maleVoiceType = 0;
3772 int femaleVoiceType = 0;
3773 if (player.IsMale())
3774 {
3775 maleVoiceType = player.GetVoiceType();
3776 }
3777 else
3778 {
3779 femaleVoiceType = player.GetVoiceType();
3780 }
3781
3782 soundBuilder.AddVariable("male", maleVoiceType);
3783 soundBuilder.AddVariable("female", femaleVoiceType);
3784
3785
3786 SoundObject soundObject = soundBuilder.BuildSoundObject();
3787 if (soundObject != NULL)
3788 {
3790 wave =
PlaySound(soundObject, soundBuilder);
3791 }
3792
3793 }
3794
3795 return wave;
3796 }
void AttenuateSoundIfNecessary(SoundObject soundObject)
override SoundObjectBuilder GetSoundBuilder(int eventId, int parameterHash)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
proto native int Hash()
Returns hash of string.