DayZ 1.27
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 строка 4382

4383 {
4384 if (!GetGame().IsDedicatedServer())
4385 {
4386 if (ConfigIsExisting("attachSoundSet"))
4387 {
4388 string cfg_path = "";
4389 string soundset = "";
4390 string type_name = GetType();
4391
4392 TStringArray cfg_soundset_array = new TStringArray;
4393 TStringArray cfg_slot_array = new TStringArray;
4394 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
4395 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
4396
4397 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4398 {
4399 for (int i = 0; i < cfg_soundset_array.Count(); i++)
4400 {
4401 if (cfg_slot_array[i] == slot_type)
4402 {
4403 soundset = cfg_soundset_array[i];
4404 break;
4405 }
4406 }
4407 }
4408
4409 if (soundset != "")
4410 {
4411 EffectSound sound = SEffectManager.PlaySound(soundset, GetPosition());
4412 sound.SetAutodestroy(true);
4413 }
4414 }
4415 }
4416 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:603
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

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