Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EditorRestrictionZoneEntity.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/ZoneRestriction", description: "Editor restriction zone to restrict players from leaving an specific area", color: "255 0 0 255")]
2class SCR_EditorRestrictionZoneEntityClass: GenericEntityClass
3{
4};
6{
7 [Attribute("6", desc: "Will warn the player for going the given distance from the zone center")]
8 protected float m_fWarnRadius;
9
10 [Attribute("12", desc: "Will kill the player for going the given distance from the zone center. Needs to be equal or higher then m_fWarnRadius")]
11 protected float m_fZoneRadius;
12
13 [Attribute("18", desc: "The distance when a player is concidered teleported. The player will not die if moved out of the zone by the given distance")]
14 protected float m_fZoneTeleportedRadius;
15
16 [Attribute("1", desc: "Which warning UIinfo needs to be shown on the screen as defined in 'SCR_RestrictionZoneWarningHUDComponent'", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(ERestrictionZoneWarningType))]
18
19 protected float m_fWarnRadiusSq;
20 protected float m_fZoneRadiusSq;
22
28 {
29 return m_fZoneRadius;
30 }
31
37 {
38 return m_fZoneRadiusSq;
39 }
40
46 {
47 return m_fWarnRadius;
48 }
49
55 {
56 return m_fWarnRadiusSq;
57 }
58
67
76
77 override protected void EOnInit(IEntity owner)
78 {
79 BaseGameMode gamemode = GetGame().GetGameMode();
80
81 if (!gamemode)
82 return;
83
84 SCR_PlayersRestrictionZoneManagerComponent restrictionZoneManager = SCR_PlayersRestrictionZoneManagerComponent.Cast(gamemode.FindComponent(SCR_PlayersRestrictionZoneManagerComponent));
85
86 if (!restrictionZoneManager)
87 return;
88
89 if (m_fZoneRadius <= 0)
90 m_fZoneRadius = 10;
91
94
98
99 restrictionZoneManager.AddRestrictionZone(this);
100 }
101
103 {
104 if (!Replication.IsServer() || SCR_Global.IsEditMode(this))
105 return;
106
108 }
109
111 {
112 if (!Replication.IsServer() || SCR_Global.IsEditMode(this))
113 return;
114
115 BaseGameMode gamemode = GetGame().GetGameMode();
116
117 if (!gamemode)
118 return;
119
120 SCR_PlayersRestrictionZoneManagerComponent restrictionZoneManager = SCR_PlayersRestrictionZoneManagerComponent.Cast(gamemode.FindComponent(SCR_PlayersRestrictionZoneManagerComponent));
121
122 if (!restrictionZoneManager)
123 return;
124
125 restrictionZoneManager.RemoveRestrictionZone(this);
126 }
127};
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
proto external EntityEvent SetEventMask(EntityEvent e)
Definition Math.c:13
Main replication API.
Definition Replication.c:14
void SCR_EditorRestrictionZoneEntity(IEntitySource src, IEntity parent)
static bool IsEditMode()
Definition Functions.c:1566
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14