Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ReconTaskEntity.c
Go to the documentation of this file.
4
5class SCR_ReconTaskEntity : SCR_Task
6{
7 protected RplComponent m_RplComponent;
8
9 //------------------------------------------------------------------------------------------------
10 protected void AddXPReward()
11 {
12 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_XPHandlerComponent));
13 if (!comp || !m_RplComponent || m_RplComponent.IsProxy())
14 return;
15
16 // add XP to all players in the assigned group
17 array<int> assigneePlayerIDs = GetTaskAssigneePlayerIDs();
18 if (!assigneePlayerIDs)
19 return;
20
21 foreach (int playerID : assigneePlayerIDs)
22 {
23 comp.AwardXP(playerID, SCR_EXPRewards.RECON_TASK_COMPLETED, 1.0, false);
24 }
25 }
26
27 //------------------------------------------------------------------------------------------------
28 override void SetTaskState(SCR_ETaskState state)
29 {
30 if (state == SCR_ETaskState.COMPLETED)
32
33 super.SetTaskState(state);
34 }
35
36 //------------------------------------------------------------------------------------------------
37 override void EOnInit(IEntity owner)
38 {
39 super.EOnInit(owner);
40
41 m_RplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
42 }
43}
ArmaReforgerScripted GetGame()
Definition game.c:1398
override void SetTaskState(SCR_ETaskState state)
SCR_BaseGameMode GetGameMode()
RplComponent m_RplComponent
void AddXPReward()
array< int > GetTaskAssigneePlayerIDs()
Definition SCR_Task.c:458
void SCR_Task(IEntitySource src, IEntity parent)
Definition SCR_Task.c:1938
SCR_ETaskState
Definition SCR_Task.c:3
proto external Managed FindComponent(typename typeName)
override void EOnInit(IEntity owner)