Fastest way to check proximity? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fastest way to check proximity? (
/showthread.php?tid=184199)
Fastest way to check proximity? -
CrucixTM - 18.10.2010
My gamemode features lots of radioactive areas, sometimes very small ones.
I don't think 100-150 areas with radiation is an exaggeration - so how can I check the players proximity to all of these points the fastest?
I mean, one timer that has to check for this many points and add a certain amount of radiation every second, that'll be lagging, won't it?
Any help on this would be appreciated. Also any faster alternatives than IsPlayerInRangeOfPoint would be nice.
Re: Fastest way to check proximity? -
Mauzen - 18.10.2010
You could subdivide your map into smaller areas, then only check for proximity to zones in the area the player is in.
If you can use rectangular zones instead of circular (isplayerinrangeofpoint) it will also be faster, because checking for them is simpler.