DayZ 1.24
Loading...
Searching...
No Matches
WeaponStartAction.c
Go to the documentation of this file.
1
5{
7 int m_actionType;
8
10 {
12 m_actionType = actionType;
13 }
14
15 override void OnEntry(WeaponEventBase e)
16 {
17 super.OnEntry(e);
18 if (e)
19 {
20 if (e.m_player)
21 {
22 HumanCommandWeapons hcw = e.m_player.GetCommandModifier_Weapons();
23 if (hcw)
24 {
25 HumanCommandAdditives ad = e.m_player.GetCommandModifier_Additives();
26 if (ad)
27 ad.CancelModifier();
28
29 hcw.StartAction(m_action, m_actionType);
30
31 if (hcw.GetRunningAction() == m_action && hcw.GetRunningActionType() == m_actionType)
32 {
33 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("HCW: playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished());
34 }
35 else
36 Error("HCW: NOT playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished());
37 }
38 else if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType));
39 }
40 else
41 {
42 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType));
43 }
44 }
45 }
46 override void OnExit(WeaponEventBase e)
47 {
48 super.OnExit(e);
49 }
50};
51
void wpnDebugPrint(string s)
Definition Debug.c:9
class WeaponEndAction extends WeaponStartAction m_action
static bool IsWeaponLogEnable()
Definition Debug.c:799
signalize mechanism manipulation
Definition Events.c:35
simple class starting animation action specified by m_action and m_actionType
represent weapon state base
Definition BulletHide.c:2
void WeaponStartAction(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type
override void OnEntry(WeaponEventBase e)
override void OnExit(WeaponEventBase e)
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
WeaponActions
actions
Definition human.c:796
string WeaponActionTypeToString(int A, int AT)
Definition human.c:923
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1086