Problem with Arrays
#1

Hi,

I have two teams, Teams are set to a player variable, (pTeam).
The Team IDs are 1 and 2.
Each team has a selection of 3 Skin choices, these skins are normal skin IDs.

I am trying to find a way to create a way to read skins that are available in specific variables, and I have no idea how to do that, I know it might sound silly, but I can't figure out how to do this.

I've tried with an enumerator by going:
pawn Код:
enum e_SkinDetails {
    TeamId,
    SkinId
}

new TeamSkin[8][e_SkinDetails] {
    {1, 110},
    {1, 109},
    {1, 144},
    {1, 173}
    {2, 287},
    {2, 285},
    {2, 121},
    {2, 284}
}
But the result that I want is to be able to type
TeamSkin[8][TeamID][EntryNumber between 0 and 3] and get get the relevant Skin ID.

Thanks, please let me know if I have not been clear.

Regards

Matt
Reply
#2

Solved, I just did it a different way...

pawn Код:
new TeamSkin[2][8];
TeamSkin[0][0] = 110;
TeamSkin[0][1] = 109;
TeamSkin[0][2] = 144;
TeamSkin[0][3] = 173;

TeamSkin[1][0] = 287;
TeamSkin[1][1] = 285;
TeamSkin[1][2] = 121;
TeamSkin[1][3] = 284;
Reply
#3

pawn Код:
#define MAX_TEAMS 2

new
    TeamSkin[MAX_TEAMS][4] = {
        {110, 109, 144, 173}, // Team 0
        {287, 285, 121, 284}  // Team 1
    };
I think that's the closest you can get.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
#define MAX_TEAMS 2

new
    TeamSkin[MAX_TEAMS][4] = {
        {110, 109, 144, 173}, // Team 0
        {287, 285, 121, 284}  // Team 1
    };
I think that's the closest you can get.
Aha, that works great, thanks Vince!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)