Posts: 85
Threads: 22
Joined: Jul 2016
Reputation:
0
Hi
I see alot of scripters use "SetPVarInt"..
I would like to know why they use it and what it's function..
Posts: 2,863
Threads: 99
Joined: Nov 2009
Reputation:
0
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.
Posts: 1,773
Threads: 47
Joined: Jan 2015
Reputation:
0
Since memory is not an issue at this age, you are free to use them.
Posts: 6,242
Threads: 8
Joined: Jun 2008
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.
Posts: 6,242
Threads: 8
Joined: Jun 2008
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.