Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FastTravelAction.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
5 {
7 if (!gadgetManager)
8 return;
9
10 IEntity mapGadget = gadgetManager.GetGadgetByType(EGadgetType.MAP);
11 if (!mapGadget)
12 return;
13
14 gadgetManager.SetGadgetMode(mapGadget, EGadgetMode.IN_HAND);
15 SCR_FastTravelComponent.ToggleMapDestinationSelection(true);
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override bool CanBePerformedScript(IEntity user)
20 {
22 return false;
23
24 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
25 if (!factionManager)
26 return false;
27
28 Faction faction = factionManager.GetLocalPlayerFaction();
29 if (!faction)
30 return false;
31
32 array<SCR_SpawnPoint> spawnPoints = SCR_SpawnPoint.GetSpawnPointsForFaction(faction.GetFactionKey());
33 return (spawnPoints.Count() > 1);
34 }
35
36 //------------------------------------------------------------------------------------------------
37 override bool HasLocalEffectOnlyScript()
38 {
39 return true;
40 }
41}
ArmaReforgerScripted GetGame()
Definition game.c:1398
void SCR_FactionManager(IEntitySource src, IEntity parent)
override bool HasLocalEffectOnlyScript()
void SetGadgetMode(IEntity gadget, EGadgetMode targetMode, bool doFocus=false)
IEntity GetGadgetByType(EGadgetType type)
static SCR_GadgetManagerComponent GetGadgetManager(IEntity entity)
static IEntity GetLocalControlledEntity()
Spawn point entity defines positions on which players can possibly spawn.
@ PerformAction