Regarding PVars - 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: Regarding PVars (
/showthread.php?tid=196606)
Regarding PVars -
Rachael - 06.12.2010
I've been using them for a while, without any obvious problems, however I have a few questions that have arisen from reading other scripts, and the wiki.
1) I Understand PVars are more memory efficient, but are they slower than normal Arrays?
2) I have noticed some scripters delete them OnPlayerDisconnect, is this nescessary? does doing this conserve resources?
3) I have some PVar manipulation under OnQueryFinish, will this cause problems if a PVar is set / changed for a player that has disconnected? and if not will the PVar be reset when another player joins? ( this question also applies to any accidental PVar manipulation )
4) Are there any issues with setting PVars for NPC's?
Re: Regarding PVars -
cessil - 06.12.2010
1. yes they are slower there has been test but I prefer to use them anyway.
2. they get deleted when a player disconnects so it's not necessary
3. umm not sure I understand, PVars will survive until OnPlayerDisconnect has finished being called
4. never used bots before but I assume they'd be fine to use
Re: Regarding PVars -
bigcomfycouch - 06.12.2010
PVars work fine for bots.