you can actually do this in a foreach i found out.
_mindis = 999999
_closest = objnull
"?_x distance player < _mindis:_mindis = _x distance player;_closest = _x" foreach _aleaders
not sure why the other thing didn't work unless _aleaders was undefined....