Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_PlayerRadioSpawnPoint.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/GameMode"
, description:
""
)]
2
class
SCR_PlayerRadioSpawnPointClass
:
SCR_PlayerSpawnPointClass
3
{
4
}
5
6
class
SCR_PlayerRadioSpawnPoint : SCR_PlayerSpawnPoint
7
{
8
//------------------------------------------------------------------------------------------------
9
protected
void
OnItemAdded
(
IEntity
item, BaseInventoryStorageComponent storageOwner)
10
{
11
BaseLoadoutClothComponent
loadoutCloth =
BaseLoadoutClothComponent
.Cast(item.
FindComponent
(
BaseLoadoutClothComponent
));
12
if
(loadoutCloth && loadoutCloth.GetAreaType() && loadoutCloth.GetAreaType().IsInherited(
LoadoutBackpackArea
) && item.
FindComponent
(SCR_RadioComponent))
13
super.ActivateSpawnPoint();
14
}
15
16
//------------------------------------------------------------------------------------------------
17
protected
void
OnItemRemoved
(
IEntity
item, BaseInventoryStorageComponent storageOwner)
18
{
19
BaseLoadoutClothComponent
loadoutCloth =
BaseLoadoutClothComponent
.Cast(item.
FindComponent
(
BaseLoadoutClothComponent
));
20
if
(loadoutCloth && loadoutCloth.GetAreaType() && loadoutCloth.GetAreaType().IsInherited(
LoadoutBackpackArea
) && item.
FindComponent
(SCR_RadioComponent))
21
super.DeactivateSpawnPoint();
22
}
23
24
//------------------------------------------------------------------------------------------------
25
override
protected
void
ActivateSpawnPoint
()
26
{
27
//--- Track when the player picks up or drops radio backpack
28
SCR_InventoryStorageManagerComponent inventoryManager = SCR_InventoryStorageManagerComponent.Cast(m_TargetPlayer.FindComponent(SCR_InventoryStorageManagerComponent));
29
if
(inventoryManager)
30
{
31
inventoryManager.m_OnItemAddedInvoker.Insert(
OnItemAdded
);
32
inventoryManager.m_OnItemRemovedInvoker.Insert(
OnItemRemoved
);
33
}
34
35
//--- If the player currently has a radio backpack, activate the spawn point instantly
36
EquipedLoadoutStorageComponent loadoutStorage = EquipedLoadoutStorageComponent.Cast(m_TargetPlayer.FindComponent(EquipedLoadoutStorageComponent));
37
if
(loadoutStorage)
38
{
39
IEntity
backpack = loadoutStorage.GetClothFromArea(
LoadoutBackpackArea
);
40
if
(backpack)
41
OnItemAdded
(backpack, null);
42
}
43
}
44
45
//------------------------------------------------------------------------------------------------
46
override
protected
void
DeactivateSpawnPoint
()
47
{
48
if
(m_TargetPlayer)
49
{
50
SCR_InventoryStorageManagerComponent inventoryManager = SCR_InventoryStorageManagerComponent.Cast(m_TargetPlayer.FindComponent(SCR_InventoryStorageManagerComponent));
51
if
(inventoryManager)
52
{
53
inventoryManager.m_OnItemAddedInvoker.Remove(
OnItemAdded
);
54
inventoryManager.m_OnItemRemovedInvoker.Remove(
OnItemRemoved
);
55
}
56
}
57
58
super.DeactivateSpawnPoint();
59
}
60
}
OnItemAdded
void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
Definition
SCR_ArsenalInventoryStorageManagerComponent.c:56
OnItemRemoved
void OnItemRemoved(BaseInventoryStorageComponent storageOwner, IEntity item)
Definition
SCR_ArsenalInventoryStorageManagerComponent.c:95
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
ActivateSpawnPoint
void ActivateSpawnPoint()
Definition
SCR_PlayerRadioSpawnPoint.c:25
DeactivateSpawnPoint
void DeactivateSpawnPoint()
Definition
SCR_PlayerRadioSpawnPoint.c:46
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
BaseLoadoutClothComponent
Definition
BaseLoadoutClothComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
LoadoutBackpackArea
Definition
LoadoutBackpackArea.c:13
SCR_PlayerRadioSpawnPointClass
Definition
SCR_PlayerRadioSpawnPoint.c:3
SCR_PlayerSpawnPointClass
Definition
SCR_PlayerSpawnPoint.c:3
scripts
Game
GameMode
Respawn
SCR_PlayerRadioSpawnPoint.c
Generated by
1.17.0