Hope this is easy to follow
// spotter.sqf
// res = [spotterunit]execVM"spotter.sqf"
// Looking for EAST units
_spotter = _this select 0;
_maxrange = 1200;
_trigger = createTrigger ["EmptyDetector", getPos vehicle _spotter];
_trigger setTriggerActivation ["EAST", "PRESENT", false];
_trigger setTriggerArea [_maxrange, _maxrange, 0, false];
_trigger setTriggerType "NONE";
_trigger setTriggerStatements ["this", "", ""];
_trigger setTriggerTimeout [0, 0, 0, false ];
// The trigger is created, its list will contain any EAST unit or vehicle present and closer than 1200m to its center
while {alive _spotter} do
{
// Trigger is placed at spotter (or spotter vehicle) postion
_trigger setPos getPos vehicle _spotter;
// We wait a second to make sure the list of the trigger is correctly updated after the change of position
Sleep 1;
// Now the list is examined, looking for units known by the spotter
{
if (_spotter knowsAbout _x > 0) then
{
hint format["Our spotter knows something about %1 which is at %2 heading to %3", _x, getPos _x, getDir _x];
};
} forEach list _trigger;
Sleep 3;
};
deleteVehicle _trigger;