Hello im new to the forums and new to making arma 3 mission i have made my first pvp conquest mission were players have to capture the zone and hold it i am wanting to show player names above there heads so people no there friendly at about 200m but only to show player names at further distances when there in line of sight ill post the code that i have so far any help would be great thanks.
onEachFrame {
_units = nearestObjects[(visiblePosition player),["Man"],500];
_units = _units - [player];
{
_color = switch (playerSide) do {
case (EAST): {[1,0,0,1]};
case (WEST): {[0,0,1,1]};
case (independent): {[0,1,0,1]};
case default {[1,1,1,1]};
};
if (side _x isEqualto playerSide) then {
if (!(lineIntersects [getPos player, getPos _x, player, _x]) && alive _x) then {
drawIcon3D [
"",
_color,
[visiblePosition _x select 0,visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5],
1,
2,
45,
name _x,
1,
0.04,
"PuristaMedium",
"center"
];
};
};
}forEach _units;
};