Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerHubAreaTriggerEnity.c
Go to the documentation of this file.
1[EntityEditorProps(category: "Editor", description: "Trigger entity for Player Hub.", color: "0 0 255 255")]
5
6//------------------------------------------------------------------------------------------------
7class SCR_PlayerHubAreaTriggerEntity : ScriptedGameTriggerEntity
8{
9 protected int m_iWarningTimerDuration = 5;
10
11 //Todo: Kill and trigger only works on server side and doesn't properly check if the entity that left the trigger was the player!
12 //======================== TIMER COMPLETED/CANCELED ========================\\
13 void TimerDone(IEntity playerToKill, bool canceled = false)
14 {
15 if (!canceled)
16 {
17 GenericEntity genericEntity = GenericEntity.Cast(playerToKill);
18 if (genericEntity)
19 {
21 if (characterController)
22 characterController.ForceDeath();
23 }
24 }
25 }
26
27
28
29
30 //****************//
31 //OVERRIDE METHODS//
32 //****************//
33
34 //------------------------------------------------------------------------------------------------
36 override void OnActivate(IEntity ent)
37 {
38 //Always canceles timer no matter which hub is entered
40 }
41
43 override void OnDeactivate(IEntity ent)
44 {
45 //Always start timer if leaving hub (Todo: Breaks if trigger in hub overlaps)
46 SCR_PlayerHubWarningEditorUIComponent.SetWarningTimer(m_iWarningTimerDuration, this, ent);
47 }
48
49
50
51 //************************//
52 //CONSTRUCTOR / DESTRUCTOR//
53 //************************//
54
55 //------------------------------------------------------------------------------------------------
56 void SCR_PlayerHubAreaTriggerEntity(IEntitySource src, IEntity parent)
57 {
58 //SetEventMask(EntityEvent.INIT);
59 }
60
61 //------------------------------------------------------------------------------------------------
62 void ~SCR_PlayerHubAreaTriggerEntity()
63 {
64 //Canceles timer (If current timer is from this hub)
65 SCR_PlayerHubWarningEditorUIComponent.CancelWarningTimer(this, true);
66 }
67
68};
override void OnDeactivate()
override void OnActivate()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
enum EVehicleType IEntity
proto external Managed FindComponent(typename typeName)
static void CancelWarningTimer(SCR_PlayerHubAreaTriggerEntity hub, bool hubDestroyed=false)