3578 {
3579 #ifdef SERVER
3580 return null;
3581 #endif
3583 DayZPlayerTypeVoiceSoundLookupTable table = type.GetVoiceSoundLookupTable();
3584 if (!table)
3585 return null;
3587 GameInventory inventory = GetInventory();
3590
3591 string category;
3592 if (mask || head_gear)
3593 {
3594 string category_mask;
3595 string category_headgear;
3596
3597 int priority_mask;
3598 int priority_headgear;
3599
3600 if (mask)
3601 {
3602 category_mask = mask.ConfigGetString("soundVoiceType");
3603 priority_mask = mask.ConfigGetInt("soundVoicePriority");
3604 }
3605 if (head_gear)
3606 {
3607 category_headgear = head_gear.ConfigGetString("soundVoiceType");
3608 priority_headgear = head_gear.ConfigGetInt("soundVoicePriority");
3609 }
3610
3611 if (priority_headgear >= priority_mask && category_headgear != "")
3612 {
3613 category = category_headgear;
3614 }
3615 else
3616 {
3617 category = category_mask;
3618 }
3619 }
3620
3621 if (category == "")
3622 {
3623 category = "none";
3624 }
3625
3627
3628 if (soundBuilder)
3629 {
3630 PlayerBase player = PlayerBase.Cast(this);
3631
3632 int maleVoiceType = 0;
3633 int femaleVoiceType = 0;
3634 if (player.IsMale())
3635 {
3636 maleVoiceType = player.GetVoiceType();
3637 }
3638 else
3639 {
3640 femaleVoiceType = player.GetVoiceType();
3641 }
3642
3643 soundBuilder.AddVariable("male", maleVoiceType);
3644 soundBuilder.AddVariable("female", femaleVoiceType);
3645
3646
3647 SoundObject soundObject = soundBuilder.BuildSoundObject();
3648 if (soundObject != NULL)
3649 {
3651 wave =
PlaySound(soundObject, soundBuilder);
3652 }
3653
3654 }
3655
3656 return wave;
3657 }
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.