Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionpullbodyfromtransport.c
Go to the documentation of this file.
2 {
4  {
5  m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
6  m_Text = "#pull_out_body";
7  }
8 
9  override void CreateConditionComponents()
10  {
11  m_ConditionItem = new CCINone();
12  m_ConditionTarget = new CCTNone();
13  }
14 
15  override bool HasProgress()
16  {
17  return false;
18  }
19 
20  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
21  {
22  PlayerBase targetPlayer = PlayerBase.Cast(target.GetObject());
23  if (!targetPlayer)
24  return false;
25 
26  if (targetPlayer.IsAlive())
27  return false;
28 
29  IEntity parent = targetPlayer.GetParent();
30  if (!parent || !parent.IsInherited(Transport))
31  return false;
32 
33  bool found = false;
34  Transport transportTarget = Transport.Cast(targetPlayer.GetParent());
35  for (int i = 0; i < transportTarget.CrewSize(); ++i)
36  {
37  if (transportTarget.CrewMember(i) == targetPlayer)
38  {
39  found = true;
40  break;
41  }
42  }
43 
44  return found && transportTarget.CrewCanGetThrough(i);
45  }
46 
47  override void OnStartServer(ActionData action_data)
48  {
49  super.OnStartServer(action_data);
50 
51  DayZPlayerImplement player;
52  if (!Class.CastTo(player, action_data.m_Target.GetObject()))
53  {
54  return;
55  }
56 
57  player.TriggerPullPlayerOutOfVehicle();
58  }
59 
60  override bool IsInstant()
61  {
62  return true;
63  }
64 }
ItemBase
Definition: inventoryitem.c:730
CCINone
Definition: ccinone.c:1
CCTNone
Definition: cctnone.c:1
IEntity
Definition: enentity.c:164
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
Transport
Base native class for all motorized wheeled vehicles.
Definition: car.c:79
DayZPlayerImplement
Definition: manbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionPullBodyFromTransport
Definition: actionpullbodyfromtransport.c:1
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53