/*original function by BI Dev Jezuro*/
/*All credit goes to him*/
markersAlpha = 0.75;
if (markersAlpha > 0) then {
	_null = [] spawn {
		scriptName "PlayerMarkers (iconDrawArray update)";
		while {TRUE} do {
			_tempArray = [];
			{
				if (isPlayer _x && _x != player && side group _x == side group player) then {_tempArray pushBack _x};
			} forEach (playableUnits + switchableUnits);
			iconDrawArray = _tempArray;
			sleep 2;
		};
	};
};

addMissionEventHandler ["Draw3D", {
	if (markersAlpha > 0) then {
		{
		if ((player distance _x) < 1000) then {
			drawIcon3D [
				"",
				[1, 0, 1, markersAlpha],
				[(position _x) select 0, (position _x) select 1, ((getPosATL _x) select 2) + 2],
				0,
				0,
				0,
				name _x,
				2
			];
		};} forEach (iconDrawArray);};
}];