Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FiringRangeLineArea.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/FiringRange", description: "Defines area from which player should shoot at target. Needs to be a child of firing line controller. ", color: "0 0 255 255")]
5
6class SCR_FiringRangeLineArea : ScriptedGameTriggerEntity
7{
10 private SCR_FiringRangeManager m_FiringRangeManager;
11
12 //------------------------------------------------------------------------------------------------
13 override void EOnInit (IEntity owner)
14 {
15 // Get its parent - firing line controller
18 return;
19
20 // And it's parent firing range manager
21 m_FiringRangeManager = SCR_FiringRangeManager.Cast(m_LineController.GetParent());
22 }
23
24 //------------------------------------------------------------------------------------------------
25 override void OnDeactivate(IEntity ent)
26 {
27 if (!m_LineController || !m_FiringRangeManager)
28 return;
29
30 // Get the ID of player who left the trigger
31 int firigLineOwner = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(ent);
32 if (!firigLineOwner)
33 return;
34
35 // If those two match, break the targets sequence
36 if (m_LineController.GetFiringLineOwnerId() == firigLineOwner)
37 m_LineController.BackToDefaultTargetsFromLineArea();
38 }
39}
ArmaReforgerScripted GetGame()
Definition game.c:1398
override void OnDeactivate()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
SCR_FiringRangeLineAreaClass m_LineController
Firing range controller.
enum EVehicleType IEntity
proto external IEntity GetParent()
override void EOnInit(IEntity owner)