23 m_Text =
"#unmount_barbed_wire";
34 Object targetObject = target.GetObject();
36 if ( targetObject && targetObject.CanUseConstruction() )
42 string selection = targetObject.GetActionComponentName( target.GetComponentIndex() );
44 if ( selection.
Length() > 0 )
46 int delimiter_index = selection.
IndexOfFrom( 0,
"_mounted" );
47 if ( delimiter_index > -1 )
49 selection = selection.
Substring( 0, delimiter_index );
51 BarbedWire barbed_wire = BarbedWire.Cast( base_building.FindAttachmentBySlotName( selection ) );
52 if ( barbed_wire && barbed_wire.IsMounted() )
68 BarbedWire barbed_wire = BarbedWire.Cast( base_building.FindAttachmentBySlotName(
m_SlotName ) );
71 barbed_wire.SetMountedState(
false );
78 string message =
string.
Format(
"Player %1 Unmounted BarbedWire from %2", action_data.
m_Player, action_data.
m_Target.GetObject() );
protected float m_SpecialtyWeight
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
protected bool m_FullBody
protected int m_StanceMask
class ActionTargets ActionTarget
protected ActionData m_ActionData
ref CABase m_ActionComponent
ref ActionTarget m_Target
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
void ActionUnmountBarbedWire()
override string GetAdminLogMessage(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
protected int m_CommandUID
protected m_CallbackClass
override bool IsPlayerInside(PlayerBase player, string selection)
const float DEFAULT_CONSTRUCT
DayZPlayerConstants
defined in C++
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.
proto native int Length()
Returns length of string.