1
Stealth archive / Re: Python not returning the right object?
« on: March 16, 2014, 09:13:33 PM »I'm using a simple function to try to see if there are any players close by. It should return true at the closest player and it works for the most part. If I run the code below it will find the closest player to me than if I move closer to a different player, but the last found player is still visible. It will return the last found player every time and not the closest player, until the last found player leaves or is to far away. Does anyone have any idea why this might be happening?
I tested out your code a bit and added the following after your "Found object" print statement:Code: [Select]print( GetX(player), GetY(player), GetZ(player) )
Adding that line just prints the location of each of the objects found. For me it looks like the functionCode: [Select]FindTypeEx
doesn't return a list sorted closest to farthest.
Let me know if I'm mis-reading something.
-S
Yes I am starting to think that the list is not sorted either. Currently doing more work on that function. I will let you know what I figure out.