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_RemoveAIGroupCommand.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
3
class
SCR_RemoveAIGroupCommand
:
SCR_BaseGroupCommand
4
{
5
//------------------------------------------------------------------------------------------------
6
override
bool
Execute(
IEntity
cursorTarget,
IEntity
target,
vector
targetPosition,
int
playerID,
bool
isClient)
7
{
8
if
(isClient)
9
{
10
//place to place a logic that would be executed for other players
11
return
true
;
12
}
13
14
SCR_PlayerController
playerController =
SCR_PlayerController
.Cast(
GetGame
().GetPlayerManager().
GetPlayerController
(playerID));
15
if
(!playerController)
16
return
false
;
17
18
SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.Cast(playerController.FindComponent(SCR_PlayerControllerGroupComponent));
19
if
(!groupController)
20
return
false
;
21
22
SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(cursorTarget);
23
if
(!character)
24
return
false
;
25
26
if
(
GetGame
().GetPlayerManager().GetPlayerIdFromControlledEntity(character) == 0)
27
groupController.RequestRemoveAgent(character, playerID);
28
29
return
true
;
30
}
31
32
//------------------------------------------------------------------------------------------------
33
override
bool
CanBeShown
()
34
{
35
if
(!
CanBeShownInCurrentLifeState
())
36
return
false
;
37
38
PlayerCamera camera =
GetGame
().GetPlayerController().GetPlayerCamera();
39
if
(!camera)
40
return
false
;
41
42
IEntity
cursorTarget = camera.GetCursorTarget();
43
SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(cursorTarget);
44
if
(!character)
45
return
false
;
46
47
SCR_PlayerController
playerController =
SCR_PlayerController
.Cast(
GetGame
().
GetPlayerController
());
48
if
(!playerController)
49
return
false
;
50
51
SCR_GroupsManagerComponent
groupManager =
SCR_GroupsManagerComponent
.GetInstance();
52
if
(!groupManager)
53
return
false
;
54
55
SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
56
if
(!groupController)
57
return
false
;
58
59
if
(!
CanRoleShow
())
60
return
false
;
61
62
if
(character.GetFaction() != playerController.
GetLocalControlledEntityFaction
())
63
return
false
;
64
65
int
playerID =
GetGame
().GetPlayerController().GetPlayerId();
66
SCR_AIGroup
playerGroup = groupManager.GetPlayerGroup(playerID);
67
68
return
playerGroup.
IsAIControlledCharacterMember
(character);
69
}
70
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
IEntity
Definition
IEntity.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::IsAIControlledCharacterMember
bool IsAIControlledCharacterMember(SCR_ChimeraCharacter character)
Definition
SCR_AIGroup.c:2659
SCR_BaseGroupCommand
Definition
SCR_BaseGroupCommand.c:4
SCR_BaseGroupCommand::CanRoleShow
override bool CanRoleShow()
Definition
SCR_BaseGroupCommand.c:44
SCR_BaseGroupCommand::CanBeShownInCurrentLifeState
override bool CanBeShownInCurrentLifeState()
Definition
SCR_BaseGroupCommand.c:101
SCR_BaseGroupCommandTitleField
Definition
SCR_PlayerCommandsConfig.c:155
SCR_BaseRadialCommand::CanBeShown
bool CanBeShown()
Definition
SCR_BaseRadialCommand.c:85
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalControlledEntityFaction
static Faction GetLocalControlledEntityFaction()
Definition
SCR_PlayerController.c:527
SCR_RemoveAIGroupCommand
Definition
SCR_RemoveAIGroupCommand.c:4
vector
Definition
vector.c:13
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
scripts
Game
Commanding
Commands
SCR_RemoveAIGroupCommand.c
Generated by
1.17.0