Posts: 134
Threads: 32
Joined: Dec 2007
Reputation:
0
gTeam[playerid] or PVarInt("Team")??
1. Are they interchangeable?
2. If so, would PVarInt be the better route?
Posts: 214
Threads: 1
Joined: May 2010
Reputation:
0
I strongly recommend not to listen to the text above.
No offense, but if you don't know anything about PVars, nor array cells, don't give wrong advices to others.
Posts: 214
Threads: 1
Joined: May 2010
Reputation:
0
I don't mean to offend you so chill out.
There is definitely wrong and right, a statement like "i think pvars are for players who cant script" is simply wrong as well as "The only thing pvars have going for them is that they can be used in other scripts where they were not declared."
This definitely shows you haven't spent enough time reading information about PVars, nontheless you give advices and potentially encourage others to follow that wrong imagination.
If you have a 20k lines script based on arrays and you don't want to convert them to PVars it is totally fine. It's a bit of work and not necessary if your server runs just well.
However if you start from scratch it'd be a step backwards to use arrays, hence if someone asks which one offers more advantages the answer simply is PVars.
Posts: 214
Threads: 1
Joined: May 2010
Reputation:
0
If a variable is not declared and you try to get its value it will return 0.
Instead of setting a PVar Integer to zero you can just delete it, as you said. It's perfectly fine and also frees the dynamically allocated memory.