SA-MP Forums Archive
Should I unload mapandreas if I already used 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: Should I unload mapandreas if I already used it? (/showthread.php?tid=529107)



Should I unload mapandreas if I already used it? - Magic_Time - 31.07.2014

Hi
Let's say I get the highest ground position from some X and Y position. After that should I unload MapAndreas if I am going to use it afterwards or not?


Re: Should I unload mapandreas if I already used it? - Sanguy - 31.07.2014

No, as far as I know you need MapAndreas loaded whenever you plan on using it.


Re: Should I unload mapandreas if I already used it? - Mauzen - 31.07.2014

No, I wouldnt recommend that. The current mapandreas version reloads the data pretty fast, but its still 0.5-1 seconds to load, and so 1 second to lag the server. So you really wouldnt want to reload that data everytime before using it.
The unload function was rather meant to be used when you wont need mapandreas anymore, to give back the used ram. E.g. when unloading the only filterscript that uses it, or when switching to a gamemode that doesnt need it.
If you just use it rarely (not in OnPlayerUpdate or fast timers) you could use the NOBUFFER mode that doesnt take up any ram. But as you usually want your script to run as fast as possible I would always recommend the normal full buffer mode unless youre really short on ram.