Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
crashbase.c
Go to the documentation of this file.
1 class CrashBase extends House
2 {
3  Particle m_ParticleEfx;
4  static bool m_Init = Init();
5 
6  static bool Init()
7  {
8  CrashSoundSets.RegisterSoundSet("HeliCrash_Distant_SoundSet");
9  CrashSoundSets.RegisterSoundSet("SledgeCrash_Distant_SoundSet");
10  return true;
11  }
12 
13  override void EEOnCECreate()
14  {
15  super.EEOnCECreate();
16  RequestSoundEvent();
17  }
18 
19  void RequestSoundEvent()
20  {
21  Param3<bool, vector, int> playSound = new Param3<bool, vector, int>(true, GetPosition(), GetSoundSet().Hash());
22  GetGame().RPCSingleParam( null, ERPCs.RPC_SOUND_HELICRASH, playSound, true );
23  }
24 
25  // needs to have the soundset registered in CrashBase.Init()
26  string GetSoundSet()
27  {
28  return "HeliCrash_Distant_SoundSet";
29  }
30 
31  override void EEInit()
32  {
33  super.EEInit();
34  //Setup for local sound tests
35  #ifdef DEVELOPER
36  if ( !GetGame().IsMultiplayer() )
37  {
38  EffectSound eff = SEffectManager.PlaySound( GetSoundSet(), GetPosition(), 0.1, 0.1 );
39  eff.SetAutodestroy(true);
40  }
41  #endif
42  }
43 
44  override void EEDelete(EntityAI parent)
45  {
46  if ( !GetGame().IsDedicatedServer() )
47  {
48  if ( m_ParticleEfx )
49  m_ParticleEfx.Stop();
50  }
51  }
52 };
GetGame
proto native CGame GetGame()
Particle
Legacy way of using particles in the game.
Definition: particle.c:6
Param3
Definition: entityai.c:95
CrashBase
Definition: wreck_mi8.c:2
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
Init
class InventoryGridController extends ScriptedWidgetEventHandler Init
Definition: uihintpanel.c:46
CrashSoundSets
Definition: dayzgame.c:44
House
Definition: crashbase.c:1
EEInit
override void EEInit()
Definition: contaminatedarea.c:27
ERPCs
ERPCs
Definition: erpcs.c:1
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
EntityAI
Definition: building.c:5