Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerRestrictionZoneWarningComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
5
6class SCR_PlayerRestrictionZoneWarningComponent : ScriptComponent
7{
9 protected bool m_bShowingWarning;
12
13 //------------------------------------------------------------------------------------------------
21 void ShowWarningServer(bool showWarning, ERestrictionZoneWarningType warningType, bool centerChanged, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
22 {
23 if ((m_bShowingWarning == showWarning && !centerChanged) || !Replication.IsServer())
24 return;
25
26 m_bShowingWarning = showWarning;
27
28 if (showWarning)
29 Rpc(ShowWarningOwner, showWarning, warningType, zoneCenter, warningRadiusSq, zoneRadiusSq);
30 else
32 }
33
34 //------------------------------------------------------------------------------------------------
35 [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
36 protected void HideWarningOwner()
37 {
38 if (m_WarningHUD)
39 m_WarningHUD.ShowZoneWarning(false, -1, vector.Zero, -1, -1);
40 }
41
42 //------------------------------------------------------------------------------------------------
43 [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
44 protected void ShowWarningOwner(bool showWarning, ERestrictionZoneWarningType warningType, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
45 {
46 if (m_WarningHUD)
47 m_WarningHUD.ShowZoneWarning(showWarning, warningType, zoneCenter, warningRadiusSq, zoneRadiusSq);
48 }
49
50 //------------------------------------------------------------------------------------------------
51 override void EOnInit(IEntity owner)
52 {
54 if (hudManager)
55 {
56 array<BaseInfoDisplay> infoDisplays = new array<BaseInfoDisplay>;
57 int count = hudManager.GetInfoDisplays(infoDisplays);
58
59 for(int i = 0; i < count; i++)
60 {
61 if (infoDisplays[i].Type() == SCR_RestrictionZoneWarningHUDComponent)
62 {
64 if (m_WarningHUD)
65 break;
66 }
67 }
68 }
69 }
70
71 //------------------------------------------------------------------------------------------------
72 override void OnPostInit(IEntity owner)
73 {
74 SetEventMask(owner, EntityEvent.INIT);
75 }
76}
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void ShowWarningServer(bool showWarning, ERestrictionZoneWarningType warningType, bool centerChanged, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
SCR_PlayerRestrictionZoneWarningComponentClass m_WarningHUD
void ShowWarningOwner(bool showWarning, ERestrictionZoneWarningType warningType, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
int Type
proto external int SetEventMask(notnull IEntity owner, int mask)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
Main replication API.
Definition Replication.c:14
void EOnInit(IEntity owner)
EntityEvent
Various entity events.
Definition EntityEvent.c:14
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition EnNetwork.c:95
RplRcver
Definition RplRcver.c:59
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition RplChannel.c:14