DayZ 1.24
Loading...
Searching...
No Matches
PlayerSoundManager.c
Go to the documentation of this file.
1
2const float SOUNDS_HEARING_DISTANCE = 50;
3
5{
10 //FREEZING,
11
12 //------
13 // add stuff above !
14 //------
15 COUNT
17
18
20{
22
25
31
33 {
34 int index = handler.GetID();
36 }
37
42
43 void Init()
44 {
45
46 }
47
48 void Update()
49 {
50
51 }
52
53
54}
55
57{
58 //------------------------
59 // REGISTER HANDLER HERE
60 //------------------------
68
69 override void Update()
70 {
71 if (m_Player.IsUnconscious())
72 return;
73
74 for (int i = 0; i < (MAX_HANDLERS_COUNT - 1); i++)
76 }
77}
78
80{
84
85 //------------------------
86 // REGISTER HANDLER HERE
87 //------------------------
88 override void Init()
89 {
94 //RegisterHandler(new FreezingSoundHandlerClient(m_Player));
95 }
96
98 {
99
100 if (!GetGame().IsDedicatedServer())
101 m_ClientCharacterDistanceCheck.Run(2, this, "CheckAllowUpdate", null, true);
102 }
103
105 {
106 if (enable)
107 {
109 m_ClientCharacterTick.Run(0.03, this, "Update", null, true);
110 }
111 else
112 {
113 m_UpdateTimerRunning = false;
115 }
116 }
117
118 override void Update()
119 {
120 if (!m_Player.IsAlive())
121 {
122 SetAllowUpdate(false);
123 return;
124 }
125
126#ifndef NO_GUI
127 for (int i = 0; i < MAX_HANDLERS_COUNT; i++)
129#endif
130 }
131
133 {
134 if (GetGame().GetPlayer())
135 {
137
139 SetAllowUpdate(false);
141 SetAllowUpdate(true);
142 //PrintString("distance:" + vector.Distance(GetGame().GetPlayer().GetPosition(), m_Player.GetPosition()).ToString());
143 }
144 }
145}
UIScriptedMenu GetHandler()
DayZPlayer m_Player
Definition Hand_Events.c:42
PlayerBase GetPlayer()
void SetAllowUpdate(bool enable)
eSoundHandlers
@ INJURY
@ THIRST
@ HUNGER
@ STAMINA
const float SOUNDS_HEARING_DISTANCE
void CheckAllowUpdate()
void PlayerSoundManagerBase(PlayerBase player)
void RegisterHandler(SoundHandlerBase handler)
ref SoundHandlerBase m_Handlers[MAX_HANDLERS_COUNT]
bool m_UpdateTimerRunning
ref Timer m_ClientCharacterDistanceCheck
void PlayerSoundManagerClient(PlayerBase player)
const int MAX_HANDLERS_COUNT
enum eSoundHandlers m_Player
class PlayerSoundManagerServer extends PlayerSoundManagerBase m_ClientCharacterTick
class JsonUndergroundAreaTriggerData GetPosition
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
proto native volatile void Update()