Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionstopengineboat.c
Go to the documentation of this file.
1
class
ActionStopEngineBoat
:
ActionSingleUseBase
2
{
3
void
ActionStopEngineBoat
()
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 =
BoatScript
.Cast(vehCommand.
GetTransport
());
23
if
(!vehicle)
24
return
false
;
25
26
if
(!vehicle.EngineIsOn())
27
return
false
;
28
29
return
vehicle.CrewDriver() == player;
30
}
31
32
override
void
OnExecute
(
ActionData
action_data)
33
{
34
HumanCommandVehicle
vehCommand = action_data.m_Player.GetCommand_Vehicle();
35
if
(!vehCommand)
36
return
;
37
38
auto
vehicle =
BoatScript
.Cast(vehCommand.
GetTransport
());
39
if
(!vehicle)
40
return
;
41
42
if
(vehicle.GetNetworkMoveStrategy() == NetworkMoveStrategy.PHYSICS)
43
{
44
// Only perform on clients (or robos), validation is performed in C++
45
if
(action_data.m_Player.GetInstanceType() ==
DayZPlayerInstanceType
.INSTANCETYPE_SERVER)
46
{
47
return
;
48
}
49
}
50
51
vehicle.EngineStop();
52
}
53
54
override
bool
CanBeUsedInVehicle
()
55
{
56
return
true
;
57
}
58
59
override
bool
UseMainItem
()
60
{
61
return
false
;
62
}
63
64
override
bool
HasTarget
()
65
{
66
return
false
;
67
}
68
}
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
ActionStopEngineBoat::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionstopengineboat.c:10
ActionStopEngineBoat::OnExecute
override void OnExecute(ActionData action_data)
Definition
actionstopengineboat.c:32
ActionStopEngineBoat::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionstopengineboat.c:16
ActionStopEngineBoat::UseMainItem
override bool UseMainItem()
Definition
actionstopengineboat.c:59
ActionStopEngineBoat::HasTarget
override bool HasTarget()
Definition
actionstopengineboat.c:64
ActionStopEngineBoat::CanBeUsedInVehicle
override bool CanBeUsedInVehicle()
Definition
actionstopengineboat.c:54
ActionStopEngineBoat::ActionStopEngineBoat
void ActionStopEngineBoat()
Definition
actionstopengineboat.c:3
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
BoatScript
Base script class for boats.
Definition
boatscript.c:42
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
HumanCommandVehicle
Definition
human.c:690
HumanCommandVehicle::GetTransport
proto native Transport GetTransport()
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
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
actionstopengineboat.c
Generated by
1.17.0