2021-02-16, 11:23 AM
You need to define what ?close? means.
1. Find the closest x load points?
Iterate over the load points, measure the player?s distance to each one and sort them. Then pick the closest x load points and show them to the player in a dialog.
2. Find all load points in range x?
Iterate over the load points, and on each iteration, measure the distance to the player and save the ones below your range x in an array. Finally, show them to the player in a dialog.
1. Find the closest x load points?
Iterate over the load points, measure the player?s distance to each one and sort them. Then pick the closest x load points and show them to the player in a dialog.
2. Find all load points in range x?
Iterate over the load points, and on each iteration, measure the distance to the player and save the ones below your range x in an array. Finally, show them to the player in a dialog.