What is the usage of this
#1

Hi
I see alot of scripters use "SetPVarInt"..
I would like to know why they use it and what it's function..
Reply
#2

(._.)

https://sampwiki.blast.hk/wiki/SetPVarInt
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=163175

tho use variables, it's faster.
Reply
#4

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
That is not the explanation of the Player Variables(PVars). The thread oMa37 posted has the explanation to PVars.
Reply
#5

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.
Reply
#6

Since memory is not an issue at this age, you are free to use them.
Reply
#7

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.
Reply
#8

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
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)