Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
advancedcommunication.c
Go to the documentation of this file.
2{
6
8 {
9 if (!g_Game.IsDedicatedServer())
10 {
11 if(g_Game.GetPlayer())
12 {
13 m_ActionsInitialize = false;
14 }
15 }
16 }
17
18 //HUD
19 /*
20 protected Hud GetHud( PlayerBase player )
21 {
22 if ( !player )
23 {
24 return NULL;
25 }
26
27 return player.m_Hud;
28 }
29
30 void DisplayRadioInfo( string message, PlayerBase player )
31 {
32 Hud hud;
33 if ( player )
34 {
35 hud = GetHud( player );
36 }
37
38 if ( hud )
39 {
40 hud.SetWalkieTalkieText( message );
41 hud.ShowWalkieTalkie( 3 );
42 }
43 }
44 */
45
46 //control transmitter via user actions
48 {
49 GetCompEM().SwitchOn();
50 }
51
53 {
54 GetCompEM().SwitchOff();
55 }
56
58 {
60 if(!m_InputActionMap)
61 {
63 m_InputActionMap = iam;
64 SetActions();
65 m_AdvComTypeActionsMap.Insert(this.Type(), m_InputActionMap);
66 }
67 }
68
69 override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
70 {
72 {
75 }
76
77 actions = m_InputActionMap.Get(action_input_type);
78 }
79
86
87 void AddAction(typename actionName)
88 {
89 ActionBase action = ActionManagerBase.GetAction(actionName);
90
91 if (!action)
92 {
93 Debug.LogError("Action " + actionName + " dosn't exist!");
94 return;
95 }
96
97 typename ai = action.GetInputType();
98 if (!ai)
99 {
100 m_ActionsInitialize = false;
101 return;
102 }
103
104 array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
105
106 if (!action_array)
107 {
108 action_array = new array<ActionBase_Basic>;
109 m_InputActionMap.Insert(ai, action_array);
110 }
111
113 {
114 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
115 }
116 action_array.Insert(action);
117 }
118
119 void RemoveAction(typename actionName)
120 {
121 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
122 ActionBase action = player.GetActionManager().GetAction(actionName);
123 typename ai = action.GetInputType();
124 array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
125
126 if (action_array)
127 {
128 action_array.RemoveItem(action);
129 }
130 }
131}
132
134{
135 override bool IsInventoryVisible()
137 return false;
139};
142{
143 proto native void SwitchOn(bool onOff);
144 proto native bool IsOn();
145};
146
147class StaticTransmitter extends AdvancedCommunication
148{
149 proto native void SwitchOn(bool onOff);
150 proto native bool IsOn();
151 proto native void SetNextChannel();
152 proto native void SetPrevChannel();
153 proto native float GetTunedFrequency();
154 proto native void EnableBroadcast(bool state);
155 proto native void EnableReceive(bool state);
156 proto native bool IsBroadcasting();
157 proto native bool IsReceiving();
158 proto native int GetTunedFrequencyIndex();
159 proto native void SetFrequencyByIndex(int index);
160};
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
void SetActions()
void InitializeActions()
proto native void EnableReceive(bool state)
proto native void SetFrequencyByIndex(int index)
proto native void SetPrevChannel()
proto native bool IsReceiving()
proto native void EnableBroadcast(bool state)
proto native float GetTunedFrequency()
proto native int GetTunedFrequencyIndex()
proto native void SetNextChannel()
proto native bool IsBroadcasting()
proto native bool IsOn()
proto native void SwitchOn(bool onOff)
Definition debug.c:2
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition debug.c:187
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition debug.c:305
TInputActionMap m_InputActionMap
void AddAction(typename actionName)
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
void AdvancedCommunication()
static ref map< typename, ref TInputActionMap > m_AdvComTypeActionsMap
void RemoveAction(typename actionName)
void TurnOffTransmitter()
static bool IsActionLogEnable()
Definition debug.c:736
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3942
string Type