DayZ 1.24
Loading...
Searching...
No Matches
ActionOpenFence.c
Go to the documentation of this file.
2{
4 const string SELECTION_INTERACT = "gate_interact";
5
7 {
8 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
9 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
10 m_Text = "#open";
11 }
12
14 {
17 }
18
19 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
20 {
21 Object targetObject = target.GetObject();
22 if (targetObject && targetObject.CanUseConstruction())
23 {
24 Fence fence = Fence.Cast(targetObject);
25
26 if (fence && fence.CanOpenFence())
27 {
29 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
30
31 for (int i = 0; i < selections.Count(); i++)
32 {
34 return true;
35 }
36 }
37 }
38
39 return false;
40 }
41
43 {
44 Fence fence = Fence.Cast(action_data.m_Target.GetObject());
45 fence.OpenFence();
46 }
47
49 {
50 m_NoisePar = new NoiseParams();
51 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
52 NoiseSystem noise = GetGame().GetNoiseSystem();
53 if (noise)
54 {
55 if (action_data.m_Player)
56 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar);
57 }
58 }
59}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
class NoiseSystem NoiseParams()
Definition Noise.c:15
ref NoiseParams m_NoisePar
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnEndServer(ActionData action_data)
override void OnStartServer(ActionData action_data)
const string SELECTION_INTERACT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()