Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionopenbarrel.c
Go to the documentation of this file.
2 {
3  void ActionOpenBarrel()
4  {
5  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
7  m_Text = "#open";
8  }
9 
10  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
11  {
12  Object target_object = target.GetObject();
13  if ( target_object.IsItemBase() )
14  {
15  Barrel_ColorBase ntarget = Barrel_ColorBase.Cast( target_object );
16  if( ntarget )
17  {
18  if( !ntarget.IsLocked() && !ntarget.IsOpen() )
19  {
20  return true;
21  }
22  }
23  }
24  return false;
25  }
26 
27  override void OnExecuteServer( ActionData action_data )
28  {
29  Object target_object = action_data.m_Target.GetObject();
30  Barrel_ColorBase ntarget = Barrel_ColorBase.Cast( target_object );
31  if( ntarget )
32  {
33  ntarget.Open();
34  }
35  }
36 
37  override void OnEndServer( ActionData action_data )
38  {
39  Object target_object = action_data.m_Target.GetObject();
40  Barrel_ColorBase ntarget = Barrel_ColorBase.Cast( target_object );
41  if( ntarget )
42  {
43  ntarget.SoundSynchRemoteReset();
44  }
45  }
46 }
ItemBase
Definition: inventoryitem.c:730
ActionOpenBarrel
Definition: actionopenbarrel.c:1
ActionInteractBase
Definition: actioninteractbase.c:54
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
Object
Definition: objecttyped.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
Barrel_ColorBase
Definition: barrel_colorbase.c:1
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53