Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionturnontransmitteronground.c
Go to the documentation of this file.
2 {
4  {
5  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7  m_Text = "#turn_on";
8  }
9 
10  override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
11  {
12  Object target_object = target.GetObject();
13  if ( player && target_object && target_object.IsStaticTransmitter() )
14  {
15  EntityAI target_entity = EntityAI.Cast( target_object );
16  string selection = target_object.GetActionComponentName( target.GetComponentIndex() );
17 
18  if ( target_entity.HasEnergyManager() && target_entity.GetCompEM().CanSwitchOn() && selection == "power_panel" )
19  {
20  AdvancedCommunication transmitter = AdvancedCommunication.Cast( target_object );
21  //transmitter.DisplayRadioInfo( "OFF", player );
22 
23  return true;
24  }
25  }
26 
27  return false;
28  }
29 
30  override void OnExecuteServer( ActionData action_data )
31  {
32  AdvancedCommunication transmitter = AdvancedCommunication.Cast( action_data.m_Target.GetObject() );
33  transmitter.TurnOnTransmitter();
34  }
35 }
ItemBase
Definition: inventoryitem.c:730
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
ActionTurnOnTransmitterOnGround
Definition: actionturnontransmitteronground.c:1
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
AdvancedCommunication
Definition: advancedcommunication.c:141
EntityAI
Definition: building.c:5