DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ PlayAttachSound()

void PlayAttachSound ( string slot_type)
protected

Plays sound on item attach. Be advised, the config structure may slightly change in 1.11 update to allow for more complex use.

См. определение в файле ItemBase.c строка 4900

4901 {
4902 if (!g_Game.IsHeadlessOrDedicatedServer())
4903 {
4904 if (ConfigIsExisting("attachSoundSet"))
4905 {
4906 string cfg_path = "";
4907 string soundset = "";
4908 string type_name = GetType();
4909
4910 TStringArray cfg_soundset_array = new TStringArray;
4911 TStringArray cfg_slot_array = new TStringArray;
4912 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
4913 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
4914
4915 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4916 {
4917 for (int i = 0; i < cfg_soundset_array.Count(); i++)
4918 {
4919 if (cfg_slot_array[i] == slot_type)
4920 {
4921 soundset = cfg_soundset_array[i];
4922 break;
4923 }
4924 }
4925 }
4926
4927 if (soundset != "")
4928 {
4929 EffectSound sound = SEffectManager.PlaySound(soundset, GetPosition());
4930 sound.SetAutodestroy(true);
4931 }
4932 }
4933 }
4934 }
eBleedingSourceType GetType()
DayZGame g_Game
Определения DayZGame.c:4074
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:607
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Определения EffectManager.c:178
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
class array< Class T > TStringArray
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки g_Game, GetPosition(), GetType(), SEffectManager::PlaySound(), EffectSound::SetAutodestroy() и TStringArray.