What is the usage of this -
BrianS123 - 25.08.2016
Hi
I see alot of scripters use "SetPVarInt"..
I would like to know why they use it and what it's function..
Re: What is the usage of this - WhiteGhost - 25.08.2016
(._.)
https://sampwiki.blast.hk/wiki/SetPVarInt
Re: What is the usage of this -
oMa37 - 25.08.2016
https://sampforum.blast.hk/showthread.php?tid=163175
tho use variables, it's faster.
Re: What is the usage of this -
DarkSkull - 25.08.2016
Quote:
Originally Posted by WhiteGhost
|
That is not the explanation of the Player Variables(PVars). The thread oMa37 posted has the explanation to PVars.
Re: What is the usage of this -
Kwarde - 26.08.2016
Indeed. It is a function to store information to a player. It's an alternative for normal variables.
SetPVarInt(playerid, "Money", 500);
Would be the same as:
new Money[MAX_PLAYERS];
Money[playerid] = 500;
A plus of PVars is that it is global; you can call these variables inside other scripts aswell. They only use alot of memory and I really dis-encourage you to use them.
Re: What is the usage of this -
Gammix - 26.08.2016
Since memory is not an issue at this age, you are free to use them.
Re: What is the usage of this -
Sew_Sumi - 26.08.2016
Quote:
Originally Posted by Gammix
Since memory is not an issue at this age, you are free to use them.
|
It's still questionable as to why people use them for simply in their script, and not cross-script as they were intended for.
Re: What is the usage of this -
Kwarde - 26.08.2016
Quote:
Originally Posted by Sew_Sumi
It's still questionable as to why people use them for simply in their script, and not cross-script as they were intended for.
|
Precisely that... I think it is called being lazy.
Also, if you have a few hundred of players and the gamemode itself is large, PVars will surely slow down the server.
@BrianS123: Read this, this is pretty interresting and a must read when considering using pvars:
https://sampforum.blast.hk/showthread.php?tid=571043
Re: What is the usage of this -
Sew_Sumi - 26.08.2016
I wouldn't say so much lazy, more just not realizing that they are able to be used by the server, not just the script.
In saying that though, there is a skill in planning this sort of use. It's not so much a "slap it together" scenario, not without really spending time getting to grips with its technique, method and purpose.
Somewhat similar to "efficient" timer use.