DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
Bleeding.c
Go to the documentation of this file.
1//checks for critical blood level and kills the character if bellow
3{
4 protected const float BLOOD_DECREMENT_PER_SEC = -10;
5 PluginAdminLog m_AdminLog;
6
7 override void Init()
8 {
10 m_ID = eModifiers.MDF_BLEEDING;
13
14 if( GetGame().IsServer() )
15 {
16 m_AdminLog = PluginAdminLog.Cast( GetPlugin(PluginAdminLog) );
17 }
18
20 }
21
22 override bool ActivateCondition(PlayerBase player)
23 {
24 float blood = player.GetHealth("","Blood");
25
27 {
28 return true;
29 }
30 return false;
31
32 }
33
34 override void OnActivate(PlayerBase player)
35 {
36 player.SetHealth("","",-1000);
37
38 if ( m_AdminLog )
39 {
40 m_AdminLog.BleedingOut( player );
41 }
42 }
43
44 override void OnDeactivate(PlayerBase player)
45 {
46
47 }
48
49 override bool DeactivateCondition(PlayerBase player)
50 {
51 return false;
52 }
53
54 override void OnTick(PlayerBase player, float deltaT)
55 {
56
57 }
58};
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
PluginBase GetPlugin(typename plugin_type)
override bool DeactivateCondition(PlayerBase player)
Definition Bleeding.c:49
override void OnActivate(PlayerBase player)
Definition Bleeding.c:34
PluginAdminLog m_AdminLog
Definition Bleeding.c:5
override void OnTick(PlayerBase player, float deltaT)
Definition Bleeding.c:54
override void Init()
Definition Bleeding.c:7
override bool ActivateCondition(PlayerBase player)
Definition Bleeding.c:22
override void OnDeactivate(PlayerBase player)
Definition Bleeding.c:44
protected const float BLOOD_DECREMENT_PER_SEC
Definition Bleeding.c:4
static const int BLOOD_THRESHOLD_FATAL
eModifiers
Definition eModifiers.c:2
proto native CGame GetGame()