DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionRaiseMegaphone.c
Go to the documentation of this file.
2{
3 private const float REPEAT_AFTER_SEC = -1.0;
4
5 override void CreateActionComponent()
6 {
8 }
9}
10
12{
14 {
15 m_CallbackClass = ActionRaiseMegaphoneCB;
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_RAISEITEM;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_RAISEITEM;
18 m_Text = "#raise_megaphone";
19 }
20
22 {
25 }
26
27 override bool HasProneException()
28 {
29 return true;
30 }
31
32 override bool HasProgress()
33 {
34 return false;
35 }
36
37 override bool HasTarget()
38 {
39 return false;
40 }
41
42 override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
43 {
44 if ( item.IsTransmitter() )
45 {
46 ItemMegaphone megaphone = ItemMegaphone.Cast( item );
47
48 if ( megaphone && megaphone.GetCompEM().IsWorking() )
49 {
50 return true;
51 }
52 }
53
54 return false;
55 }
56
57 override void OnStartServer( ActionData action_data )
58 {
59 ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
60 megaphone.SetCanSpeak( true );
61 }
62
63 override void OnEndServer( ActionData action_data )
64 {
65 ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
66 megaphone.SetCanSpeak( false );
67 }
68
69 override void OnStartClient( ActionData action_data )
70 {
71 ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
72 megaphone.SetCanSpeak( true );
73 }
74
75 override void OnEndClient( ActionData action_data )
76 {
77 ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
78 megaphone.SetCanSpeak( false );
79 }
80
81}
void CreateConditionComponents()
Definition ActionBase.c:218
void OnEndServer(ActionData action_data)
bool HasTarget()
Definition ActionBase.c:232
void OnStartClient(ActionData action_data)
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
void OnStartServer(ActionData action_data)
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool HasProgress()
For UI: hiding of progress bar.
Definition ActionBase.c:238
protected string m_Text
Definition ActionBase.c:49
void OnEndClient(ActionData action_data)
ActionRaiseMegaphoneCB ActionContinuousBaseCB ActionRaiseMegaphone()
class ActionTargets ActionTarget
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
ref CABase m_ActionComponent
Definition ActionBase.c:30
private const float REPEAT_AFTER_SEC
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasProneException()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602