Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionturnonwhileonground.c
Go to the documentation of this file.
1
class
ActionTurnOnWhileOnGround
:
ActionInteractBase
2
{
3
void
ActionTurnOnWhileOnGround
()
4
{
5
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
6
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
7
m_Text
=
"#switch_on"
;
8
}
9
10
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
11
{
12
EntityAI
target_entity =
EntityAI
.Cast( target.GetObject() );
13
14
InventoryLocation
loc =
new
InventoryLocation
;
15
target_entity.GetInventory().GetCurrentInventoryLocation(loc);
16
17
return
( player.IsAlive() && target_entity.HasEnergyManager() && target_entity.GetCompEM().CanSwitchOn() && target_entity.GetCompEM().CanWork() && loc.
GetType
() ==
InventoryLocationType
.GROUND );
18
}
19
20
override
void
OnExecuteServer
(
ActionData
action_data )
21
{
22
EntityAI
target_entity =
EntityAI
.Cast( action_data.m_Target.GetObject() );
23
24
if
( target_entity.GetCompEM().CanWork() )
25
{
26
target_entity.GetCompEM().
SwitchOn
();
27
28
InformPlayers
( action_data.m_Player, action_data.m_Target,
UA_FINISHED
);
//Success
29
}
30
else
31
{
32
InformPlayers
( action_data.m_Player, action_data.m_Target,
UA_FAILED
);
//No power
33
}
34
}
35
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::InformPlayers
void InformPlayers(PlayerBase player, ActionTarget target, int state)
DEPRECATED delivers message ids to clients based on given context.
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
ActionTurnOnWhileOnGround::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionturnonwhileonground.c:20
ActionTurnOnWhileOnGround::ActionTurnOnWhileOnGround
void ActionTurnOnWhileOnGround()
Definition
actionturnonwhileonground.c:3
ActionTurnOnWhileOnGround::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionturnonwhileonground.c:10
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
EntityAI
Definition
inventoryitem.c:2
EntityAI::SwitchOn
proto native void SwitchOn(bool onOff)
Some inventoryItem devices can be switched on/off (radios, transmitters).
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::GetType
proto native int GetType()
returns type of InventoryLocation
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
UA_FINISHED
const int UA_FINISHED
Definition
constants.c:469
UA_FAILED
const int UA_FAILED
Definition
constants.c:466
InventoryLocationType
InventoryLocationType
types of Inventory Location
Definition
inventorylocation.c:4
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionturnonwhileonground.c
Generated by
1.17.0