Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VotingAdmin.c
Go to the documentation of this file.
3 {
4  //------------------------------------------------------------------------------------------------
5  override bool IsAvailable(int value, bool isOngoing)
6  {
7  //--- Cannot vote admin when the session is hosted
8  SCR_VotingManagerComponent votingManager = SCR_VotingManagerComponent.GetInstance();
9  return votingManager && votingManager.GetHostPlayerID() == 0;
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  override void OnVotingEnd(int value = DEFAULT_VALUE, int winner = DEFAULT_VALUE)
14  {
15  if (winner != DEFAULT_VALUE)
16  GetGame().GetPlayerManager().GivePlayerRole(winner, EPlayerRole.SESSION_ADMINISTRATOR);
17  }
18 }
EPlayerRole
EPlayerRole
Definition: EPlayerRole.c:7
SCR_BaseContainerCustomTitleEnum
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
Definition: SCR_CampaignHintStorage.c:22
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_VotingReferendum
Definition: SCR_VotingBase.c:345
SCR_VotingAdmin
Definition: SCR_VotingAdmin.c:2
EVotingType
EVotingType
Definition: EVotingType.c:1
SCR_VotingManagerComponent
void SCR_VotingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_VotingManagerComponent.c:878
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468