Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionplugintofence.c
Go to the documentation of this file.
1
3{
5 {
6 m_Text = "#plug_in";
7 }
8
9 override void CreateConditionComponents()
10 {
13 }
14
15 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
16 {
17 Object targetObject = target.GetObject();
18
19 if ( targetObject && item && targetObject.IsInherited(BaseBuildingBase))
20 {
21 BaseBuildingBase target_BBB = BaseBuildingBase.Cast( targetObject );
22
23 BarbedWire bw = BarbedWire.Cast( target_BBB.GetAttachmentByType(BarbedWire) );
24
25 if ( bw && bw.GetCompEM().CanReceivePlugFrom(item) )
26 {
27 return true;
28 }
29 }
30
31 return false;
32 }
33
34 override void OnExecuteServer( ActionData action_data )
35 {
36 Object targetObject = action_data.m_Target.GetObject();
37 ItemBase target_IB = ItemBase.Cast( targetObject );
38 BarbedWire bw = BarbedWire.Cast( target_IB.GetAttachmentByType(BarbedWire) );
39 action_data.m_MainItem.GetCompEM().PlugThisInto(bw);
40
41 if ( !action_data.m_Player.IsPlacingServer() )
42 {
43 //action_data.m_Player.TogglePlacing( action_data.m_Target, action_data.m_MainItem );
44 }
45 }
46};
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65