DayZ
1.24
Loading...
Searching...
No Matches
BetaSound.c
Go to the documentation of this file.
1
class
BetaSound
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
path_sound
=
path_sound_female
;
17
18
GetGame
().ConfigGetTextArray(
path_sound
,
CachedObjectsArrays
.
ARRAY_STRING
);
19
int
rnd_index
=
Math
.
RandomInt
(0,
CachedObjectsArrays
.
ARRAY_STRING
.Count());
20
string
sound_class
=
CachedObjectsArrays
.
ARRAY_STRING
.Get(
rnd_index
);
21
SoundOnVehicle
sound_object
=
GetGame
().CreateSoundOnObject(
source
,
sound_class
,
distance
,
looped
);
22
return
sound_object
;
23
}
24
else
25
return
GetGame
().CreateSoundOnObject(
source
,
sound_name
,
distance
,
looped
);
26
}
27
28
};
GetDayZGame
DayZGame GetDayZGame()
Definition
DayZGame.c:3530
BetaSound
Definition
BetaSound.c:2
BetaSound::SaySound
static SoundOnVehicle SaySound(Object source, string sound_name, float distance, bool looped)
Definition
BetaSound.c:3
CachedObjectsArrays
Definition
UtilityClasses.c:41
CachedObjectsArrays::ARRAY_STRING
static ref TStringArray ARRAY_STRING
Definition
UtilityClasses.c:49
Math
Definition
EnMath.c:7
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
GetGame
proto native CGame GetGame()
Math::RandomInt
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
scripts
4_World
Static
BetaSound.c
Generated by
1.10.0