27.05.2010, 07:43
hey here is the code that is supposed to save my factions information...
Ok for some reason everytime i restart my server none of the factions info saves so im thinking something is wrong in the above code does anyone have an tips for me?
Код:
public SaveFactions() { new idx; new File: file2; while (idx < sizeof(FactionInfo)) { new coordsstring[512]; format(coordsstring, sizeof(coordsstring), "%s|%d|%s|%s|%s|%s|%s\n", FactionInfo[idx][fName], FactionInfo[idx][fType], FactionInfo[idx][fRank1], FactionInfo[idx][fRank2], FactionInfo[idx][fRank3], FactionInfo[idx][fRank4], FactionInfo[idx][fRank5]); if(idx == 0) { file2 = fopen("South-WestRP/Factions/factions.ini", io_write); } else { file2 = fopen("South-WestRP/Factions/factions.ini", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; }