DayZ 1.24
Loading...
Searching...
No Matches
TriggerEvents.c
Go to the documentation of this file.
1
4{
7
14
21
26 protected void Enter(TriggerInsider insider)
27 {
28#ifdef TRIGGER_DEBUG_BASIC
29 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Enter", GetDebugName(this));
30#endif
31
32 OnEnterBeginEvent(insider);
33
35 m_OnEnterInvoker.Invoke(insider);
36
37 if (GetGame().IsServer())
38 OnEnterServerEvent(insider);
39 else
40 OnEnterClientEvent(insider);
41
42 OnEnterEndEvent(insider);
43 }
44 protected void OnEnterBeginEvent(TriggerInsider insider) {}
45 protected void OnEnterServerEvent(TriggerInsider insider) {}
46 protected void OnEnterClientEvent(TriggerInsider insider) {}
47 protected void OnEnterEndEvent(TriggerInsider insider) {}
49
54 protected void StayStart(int nrOfInsiders)
55 {
56#ifdef TRIGGER_DEBUG_SPAM
57 Debug.TriggerLog(nrOfInsiders.ToString(), "TriggerEvents", "", "StayStart", GetDebugName(this));
58#endif
59
61
62 if (GetGame().IsServer())
64 else
66
68 }
69 protected void OnStayStartBeginEvent(int nrOfInsiders) {}
70 protected void OnStayStartServerEvent(int nrOfInsiders) {}
71 protected void OnStayStartClientEvent(int nrOfInsiders) {}
72 protected void OnStayStartEndEvent(int nrOfInsiders) {}
74
79 protected void Stay(TriggerInsider insider, float deltaTime)
80 {
81#ifdef TRIGGER_DEBUG_SPAM
82 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Stay", GetDebugName(this));
83#endif
84
86
87 if (GetGame().IsServer())
89 else
91
92 OnStayEndEvent(insider, deltaTime);
93 }
94 protected void OnStayBeginEvent(TriggerInsider insider, float deltaTime) {}
95 protected void OnStayServerEvent(TriggerInsider insider, float deltaTime) {}
96 protected void OnStayClientEvent(TriggerInsider insider, float deltaTime) {}
97 protected void OnStayEndEvent(TriggerInsider insider, float deltaTime) {}
99
104 protected void StayFinish()
105 {
106#ifdef TRIGGER_DEBUG_SPAM
107 Debug.TriggerLog("", "TriggerEvents", "", "StayFinish", GetDebugName(this));
108#endif
109
111
112 if (GetGame().IsServer())
114 else
116
118 }
119 protected void OnStayFinishBeginEvent() {}
120 protected void OnStayFinishServerEvent() {}
121 protected void OnStayFinishClientEvent() {}
122 protected void OnStayFinishEndEvent() {}
124
129 protected void Leave(TriggerInsider insider)
130 {
131#ifdef TRIGGER_DEBUG_BASIC
132 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Leave", GetDebugName(this));
133#endif
134
135 OnLeaveBeginEvent(insider);
136
138 m_OnLeaveInvoker.Invoke(insider);
139
140 if (GetGame() && GetGame().IsServer())
141 OnLeaveServerEvent(insider);
142 else
143 OnLeaveClientEvent(insider);
144
145 OnLeaveEndEvent(insider);
146 }
147 protected void OnLeaveBeginEvent(TriggerInsider insider) {}
148 protected void OnLeaveServerEvent(TriggerInsider insider) {}
149 protected void OnLeaveClientEvent(TriggerInsider insider) {}
150 protected void OnLeaveEndEvent(TriggerInsider insider) {}
152}
Definition Debug.c:14
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:223
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
void OnStayFinishEndEvent()
void Enter(TriggerInsider insider)
void Leave(TriggerInsider insider)
void StayStart(int nrOfInsiders)
void OnStayStartBeginEvent(int nrOfInsiders)
void OnLeaveClientEvent(TriggerInsider insider)
void OnStayFinishBeginEvent()
void OnStayServerEvent(TriggerInsider insider, float deltaTime)
void OnLeaveServerEvent(TriggerInsider insider)
void OnStayClientEvent(TriggerInsider insider, float deltaTime)
void OnLeaveEndEvent(TriggerInsider insider)
void OnEnterClientEvent(TriggerInsider insider)
void OnStayStartEndEvent(int nrOfInsiders)
void OnStayStartServerEvent(int nrOfInsiders)
ref ScriptInvoker m_OnEnterInvoker
void Stay(TriggerInsider insider, float deltaTime)
void OnLeaveBeginEvent(TriggerInsider insider)
void OnEnterServerEvent(TriggerInsider insider)
void OnStayStartClientEvent(int nrOfInsiders)
ref ScriptInvoker m_OnLeaveInvoker
void OnStayBeginEvent(TriggerInsider insider, float deltaTime)
ScriptInvoker GetOnEnterInvoker()
void OnStayFinishServerEvent()
void OnEnterEndEvent(TriggerInsider insider)
void OnEnterBeginEvent(TriggerInsider insider)
ScriptInvoker GetOnLeaveInvoker()
void OnStayFinishClientEvent()
void OnStayEndEvent(TriggerInsider insider, float deltaTime)
The object which is in a trigger and its metadata.
Definition Trigger.c:3
Object GetObject()
Definition Trigger.c:28
override string GetDebugName()
proto native CGame GetGame()