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



PVar - Balcan Fox - 31.10.2015

What is difference between using SetPVarInt and variable[MAX_PLAYERS]? What is better and which one should I use?


Re: PVar - FreAkeD - 31.10.2015

"PVars are several times slower than regular variables. It is generally more favorable to trade in memory for speed, rather than the other way round."

Source: https://sampwiki.blast.hk/wiki/Per-player_variable_system


Re: PVar - Vince - 31.10.2015

That has all been explained multiple times, please search a little. Calling a function is slower than accessing a variable. Only use PVars for cross script sharing or in cases where an array would be overkill (for example passing a value to the next dialog).