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

◆ PlayAttachSound()

void InventoryItem::PlayAttachSound ( string slot_type)
inlineprotected

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 строка 4872

4873 {
4874 if (!g_Game.IsDedicatedServer())
4875 {
4876 if (ConfigIsExisting("attachSoundSet"))
4877 {
4878 string cfg_path = "";
4879 string soundset = "";
4880 string type_name = GetType();
4881
4882 TStringArray cfg_soundset_array = new TStringArray;
4883 TStringArray cfg_slot_array = new TStringArray;
4884 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
4885 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
4886
4887 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4888 {
4889 for (int i = 0; i < cfg_soundset_array.Count(); i++)
4890 {
4891 if (cfg_slot_array[i] == slot_type)
4892 {
4893 soundset = cfg_soundset_array[i];
4894 break;
4895 }
4896 }
4897 }
4898
4899 if (soundset != "")
4900 {
4901 EffectSound sound = SEffectManager.PlaySound(soundset, GetPosition());
4902 sound.SetAutodestroy(true);
4903 }
4904 }
4905 }
4906 }
eBleedingSourceType GetType()
DayZGame g_Game
Определения DayZGame.c:3942
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:603
array< string > TStringArray
Определения EnScript.c:712
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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