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



pVars - sim_sima - 03.03.2011

Can anyone tell me about pVars? What is it?

- Thank you.


Re: pVars - Stigg - 03.03.2011

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


Re: pVars - Sasino97 - 03.03.2011

SetPVar Int/String/Float(playerid, pvar, value);

playerid: The player id
pvar: for example "Money" or "Ammo" with "" !
value: The value to assign to that var

example:

SetPVarInt(playerid, "Money", GetPlayerMoney(playerid));

it's the same thing as

new Money[MAX_PLAYERS];
Money[playerid] = GetPlayerMoney(playerid);

But with PVars you don't have to declare with "new"


Re: pVars - sim_sima - 03.03.2011

Oh. What is best to use? "new" variables or pVars?


Re: pVars - Mean - 03.03.2011

Non of them are best to use, still I would go with normal variables ( "new" ). Because they are faster than pVars. pVars = Smaller AMX size, but slower, Normal variables = Bigger AMX size, faster.
So, I never cared about AMX size, so I go with normal variables.