Respawn at nearest Hospital script not working correctly
#4

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Create 2 more checks that will check if he is in range at 100 or something for each hospital, if is not then will check with the code that you have above. This is will be a possible fix I think, not that great, but something untill you find the main problem.
Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
Instead of a check against 1000 units of distance, why don't you search for the closest hospital within THEMSELVES? Use sorting techniques or make your own, it's not difficult!

1) Get distance of each hospital from player
2) In a loop, get the smallest distance at index 0 by sorting (or simply temp vars)
3) Spawn at gArray[ 0 ][ 0 ]....
I basically used Rajat's idea by dumbing the code down to something I understood. It's still only spawning me at 1 of the 2 hospitals. Updating the topic.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)