Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerTeleportedFeedbackComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
5
6class SCR_PlayerTeleportedFeedbackComponent : ScriptComponent
7{
8 protected ref ScriptInvoker m_OnPlayerTeleported = new ScriptInvoker(); //param int GM that teleported the player
10
11 //------------------------------------------------------------------------------------------------
17
18 //------------------------------------------------------------------------------------------------
20 void PlayerTeleported(IEntity character, bool isLongFade, SCR_EPlayerTeleportedReason teleportReason)
21 {
22 //~ Do not show teleport feedback if no character
23 if (!character)
24 return;
25
26 //~ Do not show teleport feedback if dead
27 SCR_DamageManagerComponent damageManager = SCR_DamageManagerComponent.GetDamageManager(character);
28 if (damageManager && damageManager.GetState() == EDamageState.DESTROYED)
29 return;
30
31 bool editorIsOpen = SCR_EditorManagerEntity.IsOpenedInstance();
32
33 m_OnPlayerTeleported.Invoke(editorIsOpen, isLongFade, teleportReason);
34
35 //~ Player teleported by GM
36 if (teleportReason == SCR_EPlayerTeleportedReason.EDITOR)
37 {
38 //~ Only show notification if editor is closed
39 if (!editorIsOpen)
40 SCR_NotificationsComponent.SendLocal(ENotification.EDITOR_GM_TELEPORTED_PLAYER);
41 }
42 //~ Player teleported as blocking spawner
43 else if (teleportReason == SCR_EPlayerTeleportedReason.BLOCKING_SPAWNER)
44 {
45 SCR_NotificationsComponent.SendLocal(ENotification.TELEPORTED_PLAYER_BLOCKING_SPAWNER);
46 }
47 }
48}
49
ENotification
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
@ EDITOR
void PlayerTeleported(SCR_EditableCharacterComponent character, bool isLongFade, SCR_EPlayerTeleportedReason teleportReason)
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
ScriptInvoker GetOnPlayerTeleported()
Get on player Teleported script invoker.
SCR_PlayerTeleportedFeedbackComponentClass m_OnPlayerTeleported
PlayerManager m_PlayerManager
@ DEFAULT
Use currently set main RT format (based on game options).
EDamageState
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134