Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionstopengine.c
Go to the documentation of this file.
1
class
ActionStopEngine
:
ActionSingleUseBase
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
{
12
m_ConditionItem
=
new
CCINone
;
13
m_ConditionTarget
=
new
CCTNone
;
14
}
15
16
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
17
{
18
HumanCommandVehicle
vehCommand = player.GetCommand_Vehicle();
19
if
(!vehCommand)
20
return
false
;
21
22
auto
vehicle =
CarScript
.Cast(vehCommand.
GetTransport
());
23
if
(!vehicle)
24
return
false
;
25
26
if
(!vehicle.EngineIsOn())
27
return
false
;
28
29
if
(vehicle.GetSpeedometerAbsolute() > 8)
30
return
false
;
31
32
return
vehicle.CrewDriver() == player;
33
}
34
35
override
void
OnExecute
(
ActionData
action_data)
36
{
37
HumanCommandVehicle
vehCommand = action_data.m_Player.GetCommand_Vehicle();
38
if
(!vehCommand)
39
return
;
40
41
auto
vehicle =
CarScript
.Cast(vehCommand.
GetTransport
());
42
if
(!vehicle)
43
return
;
44
45
if
(vehicle.GetNetworkMoveStrategy() == NetworkMoveStrategy.PHYSICS)
46
{
47
// Only perform on clients (or robos), validation is performed in C++
48
if
(action_data.m_Player.GetInstanceType() ==
DayZPlayerInstanceType
.INSTANCETYPE_SERVER)
49
{
50
return
;
51
}
52
}
53
else
54
{
55
if
(
g_Game
.IsClient())
56
return
;
57
}
58
59
vehicle.EngineStop();
60
}
61
62
override
bool
CanBeUsedInVehicle
()
63
{
64
return
true
;
65
}
66
67
override
bool
UseMainItem
()
68
{
69
return
false
;
70
}
71
72
override
bool
HasTarget
()
73
{
74
return
false
;
75
}
76
}
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionSingleUseBase::ActionSingleUseBase
void ActionSingleUseBase()
Definition
actionsingleusebase.c:31
ActionStopEngine::ActionStopEngine
void ActionStopEngine()
Definition
actionstopengine.c:3
ActionStopEngine::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionstopengine.c:10
ActionStopEngine::OnExecute
override void OnExecute(ActionData action_data)
Definition
actionstopengine.c:35
ActionStopEngine::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionstopengine.c:16
ActionStopEngine::UseMainItem
override bool UseMainItem()
Definition
actionstopengine.c:67
ActionStopEngine::HasTarget
override bool HasTarget()
Definition
actionstopengine.c:72
ActionStopEngine::CanBeUsedInVehicle
override bool CanBeUsedInVehicle()
Definition
actionstopengine.c:62
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
CarScript
Definition
civiliansedan.c:2
HumanCommandVehicle
Definition
human.c:690
HumanCommandVehicle::GetTransport
proto native Transport GetTransport()
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerInstanceType
DayZPlayerInstanceType
defined in C++
Definition
dayzplayer.c:1071
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
singleuse
vehicles
actionstopengine.c
Generated by
1.17.0