DayZ 1.24
Loading...
Searching...
No Matches
Land_Radio_PanelPAS.c
Go to the documentation of this file.
2{
3 //Sounds
4 const string SOUND_PAS_TURN_ON = "pastransmitter_turnon_SoundSet";
5 const string SOUND_PAS_TURN_OFF = "pastransmitter_turnoff_SoundSet";
6 const string SOUND_PAS_TURNED_ON = "pastransmitter_staticnoise_SoundSet";
7
10
11 //--- BASE
12 override bool IsStaticTransmitter()
13 {
14 return true;
15 }
16
17 override bool DisableVicinityIcon()
18 {
19 return true;
20 }
21
22 //--- POWER EVENTS
23 override void OnSwitchOn()
24 {
25 super.OnSwitchOn();
26
27 if (!GetCompEM().CanWork())
28 GetCompEM().SwitchOff();
29
30 //sound
31 SoundTurnOn();
32 }
33
34 override void OnSwitchOff()
35 {
36 super.OnSwitchOff();
37
38 //sound
39 SoundTurnOff();
40 }
41
42 override void OnWorkStart()
43 {
44 super.OnWorkStart();
45
46 //turn off device
47 SwitchOn(true); // start send/receive voice
48
49 //sound
50 SoundTurnedOnNoiseStart();
51 }
52
53 override void OnWorkStop()
54 {
55 super.OnWorkStop();
56
57 //turn off device
58 SwitchOn(false); // stop send/receive voice
59
60 //sound
61 SoundTurnedOnNoiseStop();
62 }
63
64 //================================================================
65 // SOUNDS
66 //================================================================
67 //Static noise when the radio is turned on
68 protected void SoundTurnedOnNoiseStart()
69 {
70 PlaySoundSetLoop(m_SoundLoop, SOUND_PAS_TURNED_ON, 1.0, 1.0);
71 }
72
73 protected void SoundTurnedOnNoiseStop()
74 {
75 StopSoundSet(m_SoundLoop);
76 }
77
78 protected void SoundTurnOn()
79 {
80 PlaySoundSet(m_Sound, SOUND_PAS_TURN_ON, 0, 0);
81 }
82
83 protected void SoundTurnOff()
84 {
85 PlaySoundSet(m_Sound, SOUND_PAS_TURN_OFF, 0, 0);
86 }
87}
EffectSound m_Sound
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
override void OnWorkStart()
override bool DisableVicinityIcon()
EffectSound m_SoundLoop
override bool IsStaticTransmitter()
override void OnSwitchOn()
override void OnWorkStop()
override void OnSwitchOff()