DayZ 1.24
Loading...
Searching...
No Matches
DebugMonitorValues.c
Go to the documentation of this file.
2{
3 const int TYPE_HEALTH = 1;
4 const int TYPE_BLOOD = 2;
5 const int TYPE_BODY_TEMP = 3;
6 const int TYPE_POSITION = 4;
7 const int TYPE_LAST_DAMAGE = 5;
8
9 const int LAST_DAMAGE_FALL = 1;
10 const int LAST_DAMAGE_HIT = 2;
11
12 const float VALUE_CHECK_INTERVAL = 1;
13 const float SENSITIVTY_PERCENTAGE = 1;//how much the value needs to change up/down from previous update to trigger a new update(in percent)
14
17
19
23
26
30
36
37 void Init()
38 {
39 m_HealthMaxValue = m_Player.GetMaxHealth("", "Health");
40 m_BloodMaxValue = m_Player.GetMaxHealth("", "Blood");
41 }
42
44 {
45 if (GetGame().IsClient()) return;
46 if (!GetGame().IsDebugMonitor()) return; // turned off in server config
47
49
51 {
54 }
55 }
56
58 {
60 CheckBlood();
62 }
63
64 float GetBlood()
65 {
66 return m_BloodClient;
67 }
68
69 float GetHealth()
70 {
71 return m_HealthClient;
72 }
73
75 {
76 return m_LastDamageClient;
77 }
78
79 void SetLastDamage(string value)
80 {
82 }
83
99
115
125
127 {
128 switch (value_type)
129 {
132 {
134
137 //Print("SendingValue type " + value_type.ToString() + " value " + value_float.ToString());
138 GetGame().RPCSingleParam(m_Player, ERPCs.RPC_DEBUG_MONITOR_FLT, CachedObjectsParams.PARAM2_INT_FLOAT, true, m_Player.GetIdentity());
139 }
140 break;
142 {
144
147 //Print("SendingValue type " + value_type.ToString() + " value " + value_string);
148 GetGame().RPCSingleParam(m_Player, ERPCs.RPC_DEBUG_MONITOR_STR, CachedObjectsParams.PARAM2_INT_STRING, true, m_Player.GetIdentity());
149 }
150 break;
151 }
152 }
153
155 {
156 GetGame().GetMission().CreateDebugMonitor();
157
158 switch (value_type)
159 {
161 {
163 //Print("ReceivedValue health " + valueHealth.param1.ToString());
165 }
166 break;
168 {
170 //Print("ReceivedValue blood " + valueBlood.param1.ToString());
171 m_BloodClient = valueBlood.param1;
172 }
173 break;
175 {
177 //Print("ReceivedValue lastdamage " + valueLastDamage.param1);
179 }
180 break;
181 }
182 }
183
194
205};
ERPCs
Definition ERPCs.c:2
static ref Param2< int, float > PARAM2_INT_FLOAT
static ref Param2< int, string > PARAM2_INT_STRING
void SendValue(int value_type, Param param)
const float SENSITIVTY_PERCENTAGE
void OnRPCFloat(ParamsReadContext ctx)
void DebugMonitorValues(PlayerBase player)
void ReceiveValue(int value_type, Param param)
void OnRPCString(ParamsReadContext ctx)
const float VALUE_CHECK_INTERVAL
void OnScheduledTick(float deltatime)
void SetLastDamage(string value)
Definition EnMath.c:7
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto native CGame GetGame()
static proto float AbsFloat(float f)
Returns absolute value.