Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionturnoffwhileonground.c
Go to the documentation of this file.
1
class
ActionTurnOffWhileOnGround
:
ActionInteractBase
2
{
3
void
ActionTurnOffWhileOnGround
()
4
{
5
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_INTERACTONCE;
6
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
7
m_Text
=
"#switch_off"
;
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().CanSwitchOff() && 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().CanSwitchOff() )
25
{
26
target_entity.GetCompEM().SwitchOff();
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
);
//Already turned off
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
ActionTurnOffWhileOnGround::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionturnoffwhileonground.c:20
ActionTurnOffWhileOnGround::ActionTurnOffWhileOnGround
void ActionTurnOffWhileOnGround()
Definition
actionturnoffwhileonground.c:3
ActionTurnOffWhileOnGround::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionturnoffwhileonground.c:10
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
EntityAI
Definition
inventoryitem.c:2
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
actionturnoffwhileonground.c
Generated by
1.17.0