SetPVarInt question
#1

Am I better of using these PVar functions or should I be using arrays?

In the case of keeping track of a players cash. Which should I do?

pawn Код:
SetPVarInt(playerid,"pCash",100);
Or

pawn Код:
new pCash[MAX_PLAYERS];

// In a callback...
pCash[playerid] = 100;
What are the advantages and disadvantages of each? Which is faster?

I'll Rep+ anyone who can give me some useful information.
Reply
#2

SetPVarInt is better but for the speed I am not sure.
Reply
#3

https://sampwiki.blast.hk/wiki/Per-player_variable_system
Reply
#4

Ahh thank you. Sounds like it's much for effective than using arrays. Rep+
Reply
#5

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

EDIT: better https://sampforum.blast.hk/showthread.php?tid=161454

EDIT2: Arrays are better not pvars
Reply
#6

The only outstanding advantage for using PVars over Arrays is that you can share per-player-data across multiple scripts.
Reply
#7

Arrays are faster, but PVars are shared between gamemode and filterscripts.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)