Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionstopengine.c
Go to the documentation of this file.
2 {
3  void ActionStopEngine()
4  {
5  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_STOPENGINE;
6  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7  m_Text = "#stop_engine";
8  }
9 
10  override void CreateConditionComponents()
11  {
14  }
15 
16  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
17  {
18  HumanCommandVehicle vehCmd = player.GetCommand_Vehicle();
19  if (vehCmd && vehCmd.GetVehicleSeat() == DayZPlayerConstants.VEHICLESEAT_DRIVER)
20  {
21  Transport trans = vehCmd.GetTransport();
22  if (trans)
23  {
24  Car car;
25  if (Class.CastTo(car, trans) && car.EngineIsOn())
26  {
27  return car.GetSpeedometerAbsolute() <= 8;
28  }
29  }
30  }
31 
32  return false;
33  }
34 
35  override void OnExecuteServer(ActionData action_data)
36  {
37  HumanCommandVehicle vehCmd = action_data.m_Player.GetCommand_Vehicle();
38  if (vehCmd)
39  {
40  Transport trans = vehCmd.GetTransport();
41  if (trans)
42  {
43  CarScript car;
44  if (Class.CastTo(car, trans))
45  {
46  car.EngineStop();
47  }
48  }
49  }
50  }
51 
52  override void OnExecuteClient(ActionData action_data) {}
53 
54  override bool CanBeUsedInVehicle()
55  {
56  return true;
57  }
58 
59  override bool UseMainItem()
60  {
61  return false;
62  }
63 };
ItemBase
Definition: inventoryitem.c:730
CCINone
Definition: ccinone.c:1
CarScript
Definition: civiliansedan.c:1
CCTNone
Definition: cctnone.c:1
ActionStopEngine
Definition: actionstopengine.c:1
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
HumanCommandVehicle
Definition: human.c:689
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
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