DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BetaSound.c
См. документацию.
2{
3 static SoundOnVehicle SaySound(Object source, string sound_name, float distance, bool looped)
4 {
5 bool is_female = source.ConfigGetBool("woman");
6
7
8 string path_class = "CfgActionSounds " + sound_name;
9 string path_sound = path_class + " sounds";
10 //is the action sound class defined ? if not, try to play it as a regular sound
11 if( GetDayZGame().ConfigIsExisting(path_sound) )
12 {
13 string path_sound_female = path_class + "_female" + " sounds";
14
15 if(is_female && GetDayZGame().ConfigIsExisting(path_sound_female))
16 {
17 path_sound = path_sound_female;
18 }
19
21 int rnd_index = Math.RandomInt(0,CachedObjectsArrays.ARRAY_STRING.Count());
22 string sound_class = CachedObjectsArrays.ARRAY_STRING.Get(rnd_index);
23 SoundOnVehicle sound_object = GetGame().CreateSoundOnObject(source, sound_class, distance, looped);
24 return sound_object;
25 }
26 else
27 {
28 return GetGame().CreateSoundOnObject(source, sound_name, distance, looped);
29 }
30 }
31
32};
DayZGame GetDayZGame()
Определения DayZGame.c:3870
static SoundOnVehicle SaySound(Object source, string sound_name, float distance, bool looped)
Определения BetaSound.c:3
Определения BetaSound.c:2
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
static ref TStringArray ARRAY_STRING
Определения UtilityClasses.c:49
Определения EnMath.c:7
Определения ObjectTyped.c:2
proto native CGame GetGame()
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].