For the life of me I can't get this example from the BIS webpage to work. It keeps throwing an error...
[] spawn {
while {not isNull hq6} do {"hqm6" setmarkerpos getpos hq6; sleep 1;};
};
[] spawn {
if (!alive hq7) || {hq7 nearEntities [hq6,50]} exitWith {[hide,"hqm7"] call BIS_fnc_showMarkers};
else while {not isNull hq7} && (alive hq7) do {[show,"hqm7"] call BIS_fnc_showMarkers; "hqm7" setmarkerpos getpos hq7; sleep 1;};
};
pos = hq7 getPos [10, 0] vectorAdd [0,0,2];
addMissionEventHandler ["draw3D", {_k = 5 / (player distance pos); drawIcon3D ["", [1,0,0,1], pos, 1 * _k, 1 * _k, 0, "Company Executive Officer", 0, 0.04 * _k, "RobotoCondensed",];}];
This is supposed to:
1) Move a pre-placed map marker onto a players position
2) Hide the map marker if hq7 is within 50 meters of hq6
3) Hide the map marker if hq7 is not present in the worldspace
4) Display a name over the top of hq7
I have achieved 25% of this (item no.1)
Are any of the scripting gods willing to help?