Pvars question?
#3

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by Kyosaur!!
They're pretty much just global variables that are declared by the sa-mp server, i guess you could say.

They seem useless for people who know their way around pawn. I personally wont be switching everything over to this new system, as i dont see a gain. The only thing that really appeals to me about them is that they can be accessed from other scripts (i normally use callremotefunction, this isnt a bad method, but it is slower. Its not noticeable unless you have your function call in a loop tho).
It's a tiny bit slower. You will not notice any difference unless your loop is looping thousands. Regardless, this new system is definitely a gain and even prevents you from declaring the variable on your script. It also prevents you from using enums.
Enum variable:
PlayerInfo[playerid][pStats]
PVar:
GetPVarInt(playerid, "stats");
Simple as is.
I wouldnt say prevents, you can still use enums with the pvars (Dont really know why you would want to/need to tho...).


EDIT: I still dont see whats wrong with declaring MAX_PLAYER arrays, im fine losing 2kb of ram. The only thing im NOT content about is looping through them.


Can alter the a_samp include, or even do something like:

Code:
for(new a=0,b=GetMaxPlayers(); a<b; a++)
but still not very efficient for releases.
Reply


Messages In This Thread
Pvars question? - by Torran - 26.03.2010, 15:56
Re: Pvars question? - by Kyosaur - 26.03.2010, 16:06
Re: Pvars question? - by Kyosaur - 26.03.2010, 16:11
Re: Pvars question? - by Kyosaur - 26.03.2010, 17:11
Re: Pvars question? - by playbox12 - 26.03.2010, 17:53

Forum Jump:


Users browsing this thread: 1 Guest(s)