Finish the get nearest players function