Would Streamer dynamic areas do it? - 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)
+--- Thread: Would Streamer dynamic areas do it? (
/showthread.php?tid=637816)
Would Streamer dynamic areas do it? -
Eoussama - 21.07.2017
Hello, hope you all doing great,
so I want to make a fast looting system, by fast I mean, to get the system working on as less lag as possible, optimization is important of course, well, then what would be the great way to check if a player near a certain item?
Method 1
Loop through all items and use
IsPlayerInRangeOfPoint at each instance to check if the player's near the item or not
Method 2
Create tiny dynamic areas with
streamer at each item's location, and check if a player near the item if they triggered the dynamic area assigned to that item
What could work better you guys?!
Thanks in advance
Re: Would Streamer dynamic areas do it? -
Logic_ - 21.07.2017
There's also a limit of how many maximum areas there can be, also you can use iterator for that speed.
Re: Would Streamer dynamic areas do it? -
Paulice - 21.07.2017
Quote:
Originally Posted by Logic_
There's also a limit of how many maximum areas there can be, also you can use iterator for that speed.
|
And what's that limit?
OT: Method 2
Re: Would Streamer dynamic areas do it? -
AbyssMorgan - 22.07.2017
Method 3:
Create dynamic area
Set dynamic area EXTRA_ID (extraid = itemid + extraid_offset)
Next use loop for
GetPlayerDynamicAreas
GetPlayerNumberDynamicAreas
Get itemid from area extra id (itemid = extraid - extraid_offset)
The fastest method that exists.