Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
actionclosebarrel.c
Go to the documentation of this file.
1class ActionCloseBarrel: ActionInteractBase
2{
3 void ActionCloseBarrel()
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
7 m_Text = "#close";
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
32 if( ntarget )
33 {
34 ntarget.DetermineAction(action_data.m_Player);
35 if (ntarget.GetBarrelCloseSoundset() != string.Empty)
36 ntarget.StartItemSoundServer(SoundConstants.ITEM_BARREL_CLOSE);
37 }
38 }
39}
ActionBase ActionData
Definition actionbase.c:30
int m_StanceMask
Definition actionbase.c:68
string m_Text
Definition actionbase.c:64
void DetermineAction(PlayerBase player)
override bool IsOpen()
string GetBarrelCloseSoundset()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602