Well the point is just use some other variable name instead of "Playerinfo".
Hes explained it there, so no reason for me to re-explain it here.
Yes, Global Variables are indeed faster than PVars tho more complicated to use.
If you are inexperienced, and are not planning on some BIG project, you can use PVars for simplicity's sake. In case you are planning on a big project, I suggest using global vars as they are faster.
Here is the basic goods and bads list:
PVars:
-Use more memory (Edit, thanks for the correction ******)
-Reset Them selves when the player leaves (Or when he joins, doesn't matter)
-Much more understandable as they don't need those usual "confusing" characters.
Global Variables:
-Faster than PVars (Good)
-A bit harder to use (This applies only if you are new to the PAWN language)
-They must be reset (This can be a good or bad thing, you decide)
Unless you have just began to use the PAWN editor, I suggest Global Vars.
I'm not sure if he can understand those threads, nor is dedicated enough to go and check them out.
PS: I read your message again, seems you don't know how to use global vars. I cannot be your guide as there is the WIKI and many other sources you could learn this, tho i can give you an example
(At least for Player Data Storage)
Код:
enum pl_data
{
money,
admin
};
new gPlyData[MAX_PLAYERS][pl_data];
To explain you a bit of it:
This Array is 2D. I'm not good at explaining, but lets take as a example...a...table!
It has its Rows and its columns.
Each Player ID would have its Unique "row" with data written in it.
Our enum pl_data can act as a field.
You can use this code to read/write from this array.
Код:
gPlyData[5][admin] = 1; // Sets ID 5 as Admin
if (gPlyData[5][admin] == 1) Ban(5); // Checks if the Condition "is ID 5 admin" is true and if yes, ban the player.
Its just an example.