PVar vs Variables
#1

Hy

My questions is:
Which is the better?
Which is the faster?
he PVar, or the normal variable?
The PVar use stack memory or not?

Thanx for the info
Reply
#2

I think PVars are good for huge servers, containing loads of features. Loads of different stuff going on with timers and callbacks.

For a small script though, there is no harm in using normal variables.

It's like people complain when they see this:
Код:
string[256];
GetPlayerName(playerid, string, 256);
Yes, it's a waste, but you won't notice it while playing. As far as the player is concerned, you could of set the string size to 1000, the player wouldn't notice. Neither would your host to be honest.
But, if you have a server with 500 players, then you should keep it as quick as possible, 500 players settings a string size of 1000 to a 20 character name, would slow things down.

Sorry I couldn't answer your questions fully, just my opinion that's all. Normal variables were fine for 200 player servers, but with the new 500 max limit, the PVars are there to ease the strain.
Reply
#3

All answers are here - https://sampwiki.blast.hk/wiki/Per-player_variable_system
Reply
#4

Quote:
Originally Posted by Don Correlli
Ohh thanx!
Its better than the normal variables :P
Reply
#5

If you're storing player stats in PVars and saving them to a file when player disconnects, I do not recommend using /rcon gmx, because all the players, who were on the server at the moment, will lose their stats.. The stats will get reset in their account file.. Atleast thats what happened to me :\
Reply
#6

Quote:
Originally Posted by [HUN
SeoTox[Clint] ]
Its better than the normal variables :P
Of course it is, much much better. =)
Reply
#7

Has the issue that PVars are not saved upon /rcon gmx ever been reported. It would be just great if you could call a function in OnGameModeExit, saving PVars into whatever data system you use.
Reply
#8

I think PVar's is so easy to use can create them easily while coding something saves you time resting them when a player leave's makes your script looks neater and I just think there awesome I would never use Normal variables again. Plus the speed difference isn't much the human eye wouldn't notice it.

I hope so the make something like

SetVarInt("VarName", value); same for string's float's etc.

and SetVVarInt(vehicleid, "VarName", value); same for string's float's etc.

If they were done then it would be sweet as then you wouldn't need to use any variables.
Reply
#9

I'm using PVar and I'm very satistified with it!
I'm using it from now on, and I'm also using it in my comming admin system.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)