#1

Why can't I use arrays in enums? Such as...

pawn Код:
enum FacInfo
{
    fSName[255],
    fType,
    fLName[255],
    fColour[32],
    fRank[12][64],
    fDivisonS[8][64],
    fDivisonL[8][64],
};
I'm trying to script dynamic factions and want to be able to edit the names of ranks and divisions. So when I make a call in my script, such as the following, it doesn't work.

pawn Код:
format(string, sizeof(string), "Faction%dRank1=%s\n",f,FactionInfo[f][fRank[1]]); fwrite(hFile, string);
Reply
#2

pawn Код:
enum FacInfo
{
    fSName[255],
    fType,
    fLName[255],
    fColour[32],
    fRank[12][64],
    fDivisonS[8][64],
    fDivisonL[8][64],
};

new fRank[MAX_FACTIONS][12][64];
new fDivisonS[MAX_FACTIONS][8][64];
new fDivisonL[MAX_FACTIONS][8][64];
You can do it like that

Код:
format(string, sizeof(string), "Faction%dRank1=%s\n",f,fRank[f][0]); fwrite(hFile, string);
Reply
#3

I'll give that a go, thanks.

Do I still need the fRank, fDivisionL, fDivisionS in the enum?
Reply
#4

Quote:
Originally Posted by DLR
Посмотреть сообщение
I'll give that a go, thanks.

Do I still need the fRank, fDivisionL, fDivisionS in the enum?
No you don't.
Reply
#5

Seems to have compiled nicely now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)