DayZ 1.24
Loading...
Searching...
No Matches
ActionStopEngine.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_STOPENGINE;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#stop_engine";
8 }
9
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 return car.GetSpeedometerAbsolute() <= 8;
27 }
28 }
29
30 return false;
31 }
32
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 }
47
49
50 override bool CanBeUsedInVehicle()
51 {
52 return true;
53 }
54
55 override bool UseMainItem()
56 {
57 return false;
58 }
59};
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 void OnExecuteClient(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool UseMainItem()
override void CreateConditionComponents()
override bool CanBeUsedInVehicle()
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.