01.11.2013, 01:19
What The Hell??
Ok ejemplos de array.
PJ te refieres a SetPlayerSkin??
Ok ejemplos de array.
pawn Код:
//Array con una dimensiуn
new MyArray[5];
MyArray[0] = 0;
MyArray[1] = 0;
MyArray[2] = 0;
MyArray[3] = 0;
MyArray[4] = 0;
//Array con dos dimensiones
new MyArray[5][5];
MyArray[0][0] = 0;
MyArray[1][1] = 0;
MyArray[2][2] = 0;
MyArray[3][3] = 0;
MyArray[4][4] = 0;
//Array con tres dimensiones
new MyArray[5][5][5];
MyArray[0][0][0] = 0;
MyArray[1][1][1] = 0;
MyArray[2][2][2] = 0;
MyArray[3][3][3] = 0;
MyArray[4][4][4] = 0;
///Uso
/*1.- dimensiуn: en este caso usaremos playerid y MAX_PLAYERS*/
//arriba del gm
new PlayerScore[MAX_PLAYERS];
//OnPlayerDeath
PlayerScore[killerid]++;
/*2.- dimensiones: en este caso usaremos playerid, MAX_PLAYERS y enum.*/
//arriba del gm
enum valor{
pKills
}
new PlayerScore[MAX_PLAYERS][valor];
//OnPlayerDeath
PlayerScore[killerid][pKills]++;
/*3.- dimensiones: en este caso usaremos playerid, MAX_PLAYERS, enum y array dentro del enum.*/
//arriba del gm
enum valor{
pStats[2]
}
new PlayerScore[MAX_PLAYERS][valor];
//OnPlayerDeath
PlayerScore[killerid][pStats][0]++; //pKills
PlayerScore[playerid][pStats][1]++; //pDeaths
PJ te refieres a SetPlayerSkin??

