Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
actionzoomout.c
Go to the documentation of this file.
2{
4 {
5 m_Text = "#zoom_out";
6 }
7
13
14 override bool HasTarget()
15 {
16 return false;
17 }
18
19 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
20 {
21 ItemOptics optic;
22 if( Class.CastTo(optic, item) && optic.IsInOptics() )
23 {
24 return true;
25 }
26 return false;
27 }
28
29 override void OnEndServer( ActionData action_data )
30 {
31 super.OnEndServer(action_data);
32
33 ItemOptics optic;
34 if( Class.CastTo(optic, action_data.m_MainItem) )
35 {
36 optic.ExitOptics();
37 }
38 }
39};
ActionBase ActionData
Definition actionbase.c:30
class ActionTargets ActionTarget
string m_Text
Definition actionbase.c:64
ref CCIBase m_ConditionItem
Definition actionbase.c:70
ref CCTBase m_ConditionTarget
Definition actionbase.c:71
override void OnEndServer(ActionData action_data)
override void CreateConditionComponents()
void ActionZoomOut()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasTarget()
Super root of all classes in Enforce script.
Definition enscript.c:11
proto native bool IsInOptics()
is weapon in optics mode or not
proto native bool ExitOptics()
switches out of optics mode (if possible)
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.