DayZ 1.24
Loading...
Searching...
No Matches
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
10 {
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;
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
48 {
49 super.OnStartServer(action_data);
50
52 if (!Class.CastTo(player, action_data.m_Target.GetObject()))
53 return;
54
55 player.TriggerPullPlayerOutOfVehicle();
56 }
57
58 override bool IsInstant()
59 {
60 return true;
61 }
62}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnStartServer(ActionData action_data)
Super root of all classes in Enforce script.
Definition EnScript.c:11
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.