Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionturnoffpowergenerator.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#switch_off";
7 }
8
9 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
10 {
11 Object targetObject = target.GetObject();
12 ItemBase target_IB = ItemBase.Cast( targetObject );
13
14 if ( target_IB.HasEnergyManager() && target_IB.GetCompEM().CanSwitchOff() )
15 {
16 return true;
17 }
18 else
19 {
20 return false;
21 }
22 }
23
24 override void OnExecuteServer( ActionData action_data )
25 {
26 Object targetObject = action_data.m_Target.GetObject();
27 if ( targetObject )
28 {
29 ItemBase target_IB = ItemBase.Cast( targetObject );
30 target_IB.GetCompEM().SwitchOff();
31 target_IB.GetCompEM().InteractBranch(target_IB);
32 }
33 }
34};
string m_Text
Definition actionbase.c:58
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602