summaryrefslogtreecommitdiffstats
path: root/Server/PVFunctions/RequestCommanderVote.sqf
blob: cff13d4ac4e09a2350cfa687791ec9f75f84c660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Private["_commanderTeam","_side","_team"];

_side = _this;

if ((WF_Logic getVariable Format["%1CommanderVoteTime",str _side]) <= 0) then {
	_team = -1;
	_commanderTeam = (_side) Call GetCommanderTeam;

	if (!IsNull _commanderTeam) then {
		_team = (Format["WFBE_%1TEAMS",str _side] Call GetNamespace) find _commanderTeam;
	};

	[_side,_team] Call SetCommanderVotes;
	[_side] Spawn SVoteForCommander;
	["VotingForNewCommander","",_side,""] Spawn SideMessage;

	WFBE_VoteForCommander = [_side,'CLTFNCVOTEFORCOMMANDER'];
	publicVariable 'WFBE_VoteForCommander';
	if (isHostedServer) then {[_side,'CLTFNCVOTEFORCOMMANDER'] Spawn HandlePVF};
};