16.06.2015, 03:42
(
Последний раз редактировалось bgedition; 16.06.2015 в 11:44.
)
Hey all,
I have an issue with saving my zone's info. I think it is very simple issue. But I can't find it. Help, please.
The problem is when it is saving it's saving 150 new lines with zero parameters. And is there any way to make the save with sscanf? Because I am using sscanf for the load part. Help again, please.
BGEdition
I have an issue with saving my zone's info. I think it is very simple issue. But I can't find it. Help, please.
Код:
stock SaveGangZones() { new File:fHandle, fPATH[45], fLine[256], ZoneIDs; format(fPATH, sizeof(fPATH), "%s%s.txt", GANG_ZONE_PATH, GANG_ZONE_FILE); fHandle = fopen(fPATH, io_write); if(fexist(fPATH)) { if(fHandle) { for(new ZoneID; ZoneID < MAX_GANG_ZONES; ZoneID ++) { format(fLine, sizeof(fLine), "%d, %s, %d, %s, %s, %.4f, %.4f, %.4f, %.4f\r\n", ZoneInfo[ZoneID][ZONE_ID], ZoneInfo[ZoneID][ZONE_NAME], ZoneInfo[ZoneID][ZONE_OWNER_ID], ZoneInfo[ZoneID][ZONE_OWNER], ZoneInfo[ZoneID][ZONE_COLOR], ZoneInfo[ZoneID][ZONE_POS][MinX], ZoneInfo[ZoneID][ZONE_POS][MinY], ZoneInfo[ZoneID][ZONE_POS][MaxX], ZoneInfo[ZoneID][ZONE_POS][MaxY]); fwrite(fHandle, fLine); ZoneIDs += 1; } fclose(fHandle); printf("Number of gang zones saved: %d", ZoneIDs); } } return 1; }
BGEdition