Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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
Definition EPlayerRole.c:8
EVotingType
Definition EVotingType.c:2
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
void SCR_VotingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
static const int DEFAULT_VALUE