summaryrefslogtreecommitdiffstats
path: root/Client/Init/Init_BaseStructure.sqf
blob: a60bf5019c58adf4579357277485ce97ffdf8d8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
waitUntil {commonInitComplete};

if (local player) then {
	Private["_allies","_color","_hq","_marker","_structure","_text","_type","_side","_voteTime"];
	
	_structure = _this Select 0;
	_hq = _this select 1;
	_side = _this select 2;
	_allies = if (count _this > 3) then {_this select 3} else {""};

	if (_side != side player) exitWith {};
	
	sleep random(3);
	
	while {_voteTime = WF_Logic getVariable "eastCommanderVoteTime";IsNil "_voteTime"} do {sleep 1};
	
	_marker = Format["BaseMarker%1",buildingMarker];
	buildingMarker = buildingMarker + 1;
	createMarkerLocal [_marker,getPos _structure];
	_type = "mil_box";
	_color = "ColorBlue";
	if (_hq) then {_type = "Headquarters";_color = "ColorGreen"};
	if (_allies != "") then {_type = "mil_box";_color = "ColorGreen"};
	_marker setMarkerTypeLocal _type;
	_text = "";
	if (!_hq && _allies == "") then {_text = [_structure] Call GetStructureMarkerLabel;_marker setMarkerSizeLocal [0.5,0.5]};
	if (_allies != "") then {_marker setMarkerSizeLocal [0.5,0.5];_text = _allies};
	if (_text != "") then {_marker setMarkerTextLocal _text};
	_marker setMarkerColorLocal _color;
	
	while {!isNull _structure && alive _structure} do {sleep 2};

	deleteMarkerLocal _marker;
};