9 if (
m_ActionData.m_MainItem.ConfigIsExisting(
"RestrainTime") )
11 time =
m_ActionData.m_MainItem.ConfigGetFloat(
"RestrainTime");
48 return other_player.CanBeRestrained();
52 return !other_player.IsRestrained();
71 if ( target_player.IsSurrendered() || !target_player.CanBeRestrained() )
82 target_player.SetRestrainPrelocked(
true);
93 super.OnStartServer(action_data);
96 if ( target_player.IsSurrendered() )
98 SurrenderDataRestrain sdr =
new SurrenderDataRestrain;
99 target_player.EndSurrenderRequest(sdr);
101 else if ( target_player.IsEmotePlaying() )
103 target_player.m_EmoteManager.ServerRequestEmoteCancel();
106 target_player.SetRestrainStarted(
true);
111 super.OnEndServer(action_data);
116 target_player.SetRestrainStarted(
false);
117 target_player.SetRestrainPrelocked(
false);
126 if (
CanReceiveAction(action_data.m_Target) && !target_player.IsRestrained())
128 EntityAI item_in_hands_target = target_player.GetHumanInventory().GetEntityInHands();
129 EntityAI item_in_hands_source = source_player.GetHumanInventory().GetEntityInHands();
131 if ( !item_in_hands_source )
133 Error(
"Restraining target failed, nothing in hands");
137 string new_item_name = MiscGameplayFunctions.ObtainRestrainItemTargetClassname(item_in_hands_source);
138 if (item_in_hands_target)
141 MiscGameplayFunctions.TurnItemInHandsIntoItemEx(target_player, lambda2);
146 source_player.LocalReplaceItemInHandsWithNewElsewhere(lambda);
153 super.OnFinishProgressClient( action_data );
171 super.OnSuccess(new_item);
183 if (item_in_hands_source)
185 string new_item_name = MiscGameplayFunctions.ObtainRestrainItemTargetClassname(item_in_hands_source);
190 Error(
"ChainedDropAndRestrainLambda: missing source player!");
194 Error(
"ChainedDropAndRestrainLambda: missing source item in hands!");
200 super.CopyOldPropertiesToNew(old_item, new_item);
218 OverrideNewLocation(targetHnd);
223 super.OnSuccess(new_item);
void RestrainTargetPlayerLambda(EntityAI old_item, string new_item_type, PlayerBase player)
ChainedDropAndRestrainLambda m_TargetPlayer
class ActionTargets ActionTarget
ref CCIBase m_ConditionItem
bool CanReceiveAction(ActionTarget target)
ref CCTBase m_ConditionTarget
float GetActionComponentProgress()
void ActionContinuousBase()
override bool ActionConditionContinue(ActionData action_data)
override void OnStartServer(ActionData action_data)
override void OnFinishProgressServer(ActionData action_data)
void ActionRestrainTarget()
override int GetStanceMask(PlayerBase player)
override void CreateConditionComponents()
override void OnEndServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressClient(ActionData action_data)
const float DEFAULT_RESTRAIN_TIME
override void CreateActionComponent()
AnalyticsManagerClient GetAnalyticsClient()
proto native Mission GetMission()
void ChainedDropAndRestrainLambda(EntityAI old_item, string new_item_type, PlayerBase player, bool destroy=false, PlayerBase src_player=null)
ExplosivesBase m_PairedExplosive
override void OnSuccess(EntityAI new_item)
PlayerBase m_SourcePlayer
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
void DestroyItemInCorpsesHandsAndCreateNewOnGndLambda(EntityAI old_item, string new_item_type, PlayerBase player, bool destroy=false)
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
bool IsPlayerDisconnecting(Man player)
EntityAI GetControlledDevice()
override void OnSuccess(EntityAI new_item)
DayZPlayerInstanceType
defined in C++
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
const float DEBUG_QUICK_UNRESTRAIN_TIME