Faction type and slot resetting after LoadFaction is called. [rep++]
#1

Hi, the FactionType and FactionSlot keep resetting after LoadFactions is called, what is the problem?

pawn Код:
LoadFactions()
{
    new arrCoords[12][64];
    new strFromFile2[512];
    new File: file = fopen("Configs/factions.cfg", io_read);
    if(file)
    {
        new idx;
        while (idx < sizeof(FactionInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, '|');
            strmid(FactionInfo[idx][FactionName], arrCoords[0], 0, strlen(arrCoords[0]), 255);
            strmid(FactionInfo[idx][FactionMOTD], arrCoords[1], 0, strlen(arrCoords[1]), 255);
            strmid(FactionInfo[idx][FactionLeader], arrCoords[2], 0, strlen(arrCoords[2]), 255);
            strmid(FactionInfo[idx][FactionRank1], arrCoords[3], 0, strlen(arrCoords[3]), 255);
            strmid(FactionInfo[idx][FactionRank2], arrCoords[4], 0, strlen(arrCoords[4]), 255);
            strmid(FactionInfo[idx][FactionRank3], arrCoords[5], 0, strlen(arrCoords[5]), 255);
            strmid(FactionInfo[idx][FactionRank4], arrCoords[6], 0, strlen(arrCoords[6]), 255);
            strmid(FactionInfo[idx][FactionRank5], arrCoords[7], 0, strlen(arrCoords[7]), 255);
            strmid(FactionInfo[idx][FactionRank6], arrCoords[8], 0, strlen(arrCoords[8]), 255);
            FactionInfo[idx][FactionType] = strval(arrCoords[10]);//This is the error
            FactionInfo[idx][FactionSlot] = strval(arrCoords[11]);//This is the other error
            printf("[Dynamic Faction] Faction Name: %s, Type: %d, Slot: %d, ID: %d",FactionInfo[idx][FactionName],FactionInfo[idx][FactionType],FactionInfo[idx][FactionSlot],idx);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)