here you go, not tested, and not garunteed, but i think this is correct:
_unit = _this select 0
_players = _this select 1
;change this for different field of vision (in degrees)
_FoV = 5
~5
#loop
_nearby = []
_dir = getdir _unit
"_x distance _unit < 15 && vehicle _x == _x" foreach _players:_nearby = _nearby + [_x]
_fovpos1 = [(getpos _unit select 0) + 15*sin(_dir + _FoV),(getpos _unit select 1) + 15*sin(_dir + _FoV)]
_fovpos2 = [(getpos _unit select 0) + 15*sin(_dir - _FoV),(getpos _unit select 1) + 15*sin(_dir - _FoV)]
"? (_fovpos1 select 0) >= (getpos _x select 0) >= (_fovpos2 select 0) && ? (_fovpos1 select 1 >= (getpos _x select 1) >= (_fovpos2 select 1):(group _unit) reveal _x
~2
goto "loop"
it is exec'd with each unit, so you could use foreach with an array of ai's or you could edit this, but right now here is how you would use it:
each units init field [this,[*array of players*] ] exec "thisScript.sqs"
and it checks for each unit if they are 15 meters from the unit the script is running from, and within the FOV (field of view) which right now is set to 5 degrees on either side (10 total)