Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
megaphone.c
Go to the documentation of this file.
1 class Megaphone extends ItemMegaphone
2 {
3  override bool IsTransmitter()
4  {
5  return true;
6  }
7 
8  //--- POWER EVENTS
9  override void OnSwitchOn()
10  {
11  if ( !GetCompEM().CanWork() )
12  {
13  GetCompEM().SwitchOff();
14  }
15  }
16 
17  override void OnWorkStart()
18  {
19  //turn device on
20  SwitchOn ( true ); // Note: This is not Energy Manager function. This is engine function.
21  }
22 
23  override void OnWorkStop()
24  {
25  //auto switch off (EM)
26  GetCompEM().SwitchOff();
27 
28  //turn off device
29  SwitchOn ( false ); // Note: This is not Energy Manager function. This is engine function.
30  }
31 
32  //TODO add turn on/off actions
33  //proto native bool CanSpeak();
34  //proto native void SetCanSpeak(bool onOff);
35 
36  override void SetActions()
37  {
38  super.SetActions();
39 
43  }
44 
45 }
OnWorkStop
override void OnWorkStop()
Definition: m18smokegrenade_colorbase.c:2
Megaphone
@ Megaphone
CCMegaphone.
Definition: constants.c:11
ItemMegaphone
Definition: megaphone.c:1
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
ActionRaiseMegaphone
ActionRefuelTorch ActionRaiseMegaphone
ActionTurnOnTransmitter
ActionTurnOnWeaponFlashlight ActionTurnOnTransmitter
ActionTurnOffTransmitter
ActionTurnOffWeaponFlashlight ActionTurnOffTransmitter
OnWorkStart
override void OnWorkStart()
Definition: smokegrenadebase.c:175