SA-MP Forums Archive
Efficiency - 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: Efficiency (/showthread.php?tid=160883)



Efficiency - ScottCFR - 18.07.2010

Okay, I am working on a script and I've always kinda had this question. If I'm looking to see if a player comes within a range of a point would it be more efficient to set a timer with a custom call back, or use OnPlayerUpdate?


Re: Efficiency - iggy1 - 18.07.2010

Im no expert but im pretty sure a timer would be more efficient than onplayerupdate.
onplayerupdate is called many times per second the script would also check if a player is in range of point many times per second even if he/she is not in range of point.


Re: Efficiency - nemesis- - 18.07.2010

Use OnPlayerEnterDynamicArea from Incognito's streamer plugin.