Lee, if you have preset objects you want to connect sounds to then build an array of objects as follows:
_objArray = [tank1,12345,2389,45,car65];
You then use the isNumber to control how you get the distance to the player.
pseudocode
0) _close_obj = objNull
1) set _close_dist to max distance to search e.g. 300m
2) loop through _objArray
3) if isnumber(_objArray select _i) then _obj = getPos player nearestObject (_objArray select _i)
else _obj = (_objArray select _i)
4) _dist = player distance _obj
5) if _dist is smaller than _close_dist then _close_dist = _dist; _close_obj = _obj; _close_sound = _soundArray select _i;
6) end loop through _objArray
7) if (isNull _close_obj) then none of the objects are in range
else set sound source trigger and sound it to play
8) sleep 1
9) repeat ad infinitum starting at 0)
However, why do you not simply place an empty(i.e. invisible) marker everywhere you want a sound, and name the markers after the sounds or better yet store the sound name in the marker text? Then all you is find the closest marker, move the trigger to it, and set the sound to play from the marker name or text?