DayZ 1.24
Loading...
Searching...
No Matches
ActionStopEngine Class Reference
Inheritance diagram for ActionStopEngine:
[legend]
Collaboration diagram for ActionStopEngine:
[legend]

Private Member Functions

void ActionStopEngine ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
override bool CanBeUsedInVehicle ()
 
override bool UseMainItem ()
 

Detailed Description

Definition at line 1 of file ActionStopEngine.c.

Constructor & Destructor Documentation

◆ ActionStopEngine()

void ActionStopEngine::ActionStopEngine ( )
inlineprivate

Definition at line 3 of file ActionStopEngine.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_STOPENGINE;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#stop_engine";
8 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionStopEngine::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 16 of file ActionStopEngine.c.

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 return car.GetSpeedometerAbsolute() <= 8;
27 }
28 }
29
30 return false;
31 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo().

◆ CanBeUsedInVehicle()

override bool ActionStopEngine::CanBeUsedInVehicle ( )
inlineprivate

Definition at line 50 of file ActionStopEngine.c.

51 {
52 return true;
53 }

◆ CreateConditionComponents()

override void ActionStopEngine::CreateConditionComponents ( )
inlineprivate

Definition at line 10 of file ActionStopEngine.c.

11 {
14 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnExecuteClient()

override void ActionStopEngine::OnExecuteClient ( ActionData action_data)
inlineprivate

Definition at line 48 of file ActionStopEngine.c.

48{}

◆ OnExecuteServer()

override void ActionStopEngine::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 33 of file ActionStopEngine.c.

34 {
35 HumanCommandVehicle vehCmd = action_data.m_Player.GetCommand_Vehicle();
36 if (vehCmd)
37 {
38 Transport trans = vehCmd.GetTransport();
39 if (trans)
40 {
42 if (Class.CastTo(car, trans))
43 car.EngineStop();
44 }
45 }
46 }

References Class::CastTo().

◆ UseMainItem()

override bool ActionStopEngine::UseMainItem ( )
inlineprivate

Definition at line 55 of file ActionStopEngine.c.

56 {
57 return false;
58 }

The documentation for this class was generated from the following file: