IsPlayerInRangeOfPoint
#2

You can't possibly know if a player is in range of any house before having gone through all of them. I will say it once more: never return inside a loop unless you explicitly want to break it.

When the loop is entered for the first time, the code checks if the player is at house 0. If the player isn't at house 0 then the code skips the first block and goes straight to the "You are not near a house" message. Because of the return there, the function ends there and other houses aren't even checked.
Reply


Messages In This Thread
IsPlayerInRangeOfPoint - by Blademaster680 - 08.09.2014, 20:51
Re: IsPlayerInRangeOfPoint - by Vince - 08.09.2014, 21:26

Forum Jump:


Users browsing this thread: 2 Guest(s)