Code:
if (E5P == 1) then {
_color = [0.035,1,0,1];
_x1 = -0.5;
_y1 = -0.5;
_z1 = 0;
_x2 = 0.5;
_y2 = 0.5;
_z2 = 1.8;
onEachFrame {
_l49 = nearestobjects[player, ["CAManBase"], 1400]; {
if ((side _x != side player) && (getPlayerUID _x != "") && ((player distance _x) < 1400)) then {
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [_x2, _y1, 1], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [_x2, _y2, 1], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [_x1, _y2, 1], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [_x1, _y1, 1], _color];
drawLine3d [[getposatl player select 0, getposatl player select 1, getposatl player select 2],ASLToATL eyePos _x,_color];
} else {
if ((getPlayerUID _x != "") && ((player distance _x) < 1000)) then {
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [0,0,_z2], _color];
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [0, 0, _z1], _color];
drawLine3d [_x modelToWorld [_x1, _y1, 1], _x modelToWorld [_x2, _y1, 1], _color];
drawLine3d [_x modelToWorld [_x2, _y1, 1], _x modelToWorld [_x2, _y2, 1], _color];
drawLine3d [_x modelToWorld [_x2, _y2, 1], _x modelToWorld [_x1, _y2, 1], _color];
drawLine3d [_x modelToWorld [_x1, _y2, 1], _x modelToWorld [_x1, _y1, 1], _color];
drawLine3d [[getposatl player select 0, getposatl player select 1, getposatl player select 2],ASLToATL eyePos _x,_color];
};
};
}
foreach AllUnits;
};
} else {
onEachFrame {
nil
};
};
Code:
if (E5P == 1) then {
onEachFrame {
_l49 = nearestobjects[player, ["CAManBase"], 1400]; {
if ((side _x != side player) && (getPlayerUID _x != "") && ((player distance _x) < 1400)) then {
drawIcon3D["", [1, 0, 0, 1], [visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2], 0.1, 0.1, 45, (format["%2 : %1m", round(player distance _x), name _x]), 1, 0.04, "TahomaB"]
} else {
if ((getPlayerUID _x != "") && ((player distance _x) < 1000)) then {
drawIcon3D["", [0, 0.5, 1, 1], [visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2], 0.1, 0.1, 45, (format["%2 : %1m", round(player distance _x), name _x]), 1, 0.04, "TahomaB"]
};
};
}
foreach AllUnits; //changed it to works also in singleplayer
};
} else {
onEachFrame {
nil
};
};