This is declaring an array:
It's easier doing
instead of
pawn Код:
new a1;
new a2;
new a3;
new a4;
new a5;
new a6;
new a7;
new a8;
new a9;
new a10;
You can use the array in this way:
pawn Код:
a[4] = 100;
//instead of
a4 = 100;
You can add to array slot names using the enum
pawn Код:
enum info
{
pMoney,
pScore,
}
new pInfo[MAX_PLAYERS]/*WICH IS 500*/[info];
//instead of
new pMoney[MAX_PLAYERS];
new pScore[MAX_PLAYERS];
Using MAX_PLAYERS, its also using an array, because:
pawn Код:
//Because it declares an array with 500 slots (MAX_PLAYERS is 500 by default)
new Score[MAX_PLAYERS];
//DOES
new Score0; //The score of the player ID 0
new Score1; // '' ''
new Score2;
new Score3;
new Score4;
new Score5;
new Score6;
new Score7;
new Score8;
new Score9;
new Score10;
new Score11;
// [...] TO Score500;
Every number is the ID of the player in the server.
When you use "playerid" in the callbacks like OnPlayerSpawn, playerid means "The ID of the player that spawned"
So arrays are indexed variables