20.11.2016, 12:53
Hi, I'm creating a family system right now and I have 15 ranks for each family.
That's what my enumerator looks like:
That's how I load the family info:
And I get these errors:
I guess the line I marked is causing that as I don't see any mistakes in the code. Is that even possible to do it like that? That FamilyInfo[i][string] thing?
Or I can't load the ranks with a loop and I need to do it like that?:
I prefer a loop though. Anyways what's up?
That's what my enumerator looks like:
Код:
enum familyInfo { FamilyExists, FamilyName[32], FamilyStrikes, FamilyRanks, FamilyRank1[24], FamilyRank2[24], FamilyRank3[24], FamilyRank4[24], FamilyRank5[24], FamilyRank6[24], FamilyRank7[24], FamilyRank8[24], FamilyRank9[24], FamilyRank10[24], FamilyRank11[24], FamilyRank12[24], FamilyRank13[24], FamilyRank14[24], FamilyRank15[24] } new FamilyInfo[MAX_FAMILIES][familyInfo];
Код:
LoadFamilies() { new string[24], rank[24]; for (new i; i < MAX_FAMILIES; i++) if (dini_Exists(GetFamilyFile(i))) { format(FamilyInfo[i][FamilyName], 32, dini_Get(GetFamilyFile(i), "Name")); FamilyInfo[i][FamilyExists] = true; FamilyInfo[i][FamilyStrikes] = dini_Int(GetFamilyFile(i), "Strikes")); //line 1670 FamilyInfo[i][FamilyRanks] = dini_Int(GetFamilyFile(i), "Ranks")); for (new j = 1; j <= 15; j++) { format(string, sizeof(string), "Rank%d", j); format(rank, sizeof(rank), dini_Get(GetFamilyFile(i), string)); format(string, sizeof(string), "FamilyRank%d", j); format(FamilyInfo[i][string], 24, rank); } } }
Код:
(1670) : error 001: expected token: ";", but found ")" (1670) : error 029: invalid expression, assumed zero (1670) : warning 215: expression has no effect (1671) : error 001: expected token: ";", but found ")" (1671) : error 029: invalid expression, assumed zero (1671) : warning 215: expression has no effect (1679) : error 033: array must be indexed (variable "string")
Or I can't load the ranks with a loop and I need to do it like that?:
Код:
format(FamilyInfo[i][FamilyRank1], 24, dini_Get(GetFamilyFile(i), "Rank1")); format(FamilyInfo[i][FamilyRank2], 24, dini_Get(GetFamilyFile(i), "Rank2")); format(FamilyInfo[i][FamilyRank3], 24, dini_Get(GetFamilyFile(i), "Rank3")); ...to be continued