File format.
#1

pawn Код:
public OnPropUpdate()
{
    new idx;
    new File: file2;
    while (idx < sizeof(HouseInfo)) {
        new coordsstring[255];
        format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n\r",
            HouseInfo[idx][hEntrancex],
            HouseInfo[idx][hEntrancey],
            HouseInfo[idx][hEntrancez],
            HouseInfo[idx][hExitx],
            HouseInfo[idx][hExity],
            HouseInfo[idx][hExitz],
            HouseInfo[idx][hHealthx],
            HouseInfo[idx][hHealthy],
            HouseInfo[idx][hHealthz],
            HouseInfo[idx][hArmourx],
            HouseInfo[idx][hArmoury],
            HouseInfo[idx][hArmourz],
            HouseInfo[idx][hOwner],
            HouseInfo[idx][hDiscription],
            HouseInfo[idx][hValue],
            HouseInfo[idx][hHel],
            HouseInfo[idx][hArm],
            HouseInfo[idx][hInt],
            HouseInfo[idx][hLock],
            HouseInfo[idx][hOwned],
            HouseInfo[idx][hRooms],
            HouseInfo[idx][hRent],
            HouseInfo[idx][hRentabil],
            HouseInfo[idx][hTakings],
            HouseInfo[idx][hVec],
            HouseInfo[idx][hVcol1],
            HouseInfo[idx][hVcol2],
            HouseInfo[idx][hDate],
            HouseInfo[idx][hLevel],
            HouseInfo[idx][hWorld],
            HouseInfo[idx][hOutWorld],
            HouseInfo[idx][hOutInt],
            HouseInfo[idx][hOTaken]);
        HouseInfo[idx][hWorld] = idx;
        if(idx == 0) {
            file2 = fopen("cfgs/property.cfg", io_write);
        }
        else {
            file2 = fopen("cfgs/property.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}
As you see, I've got this code above, and it saves it by each line and formatting it.
But each time that someone moves a house ingame, in the property.cfg, it's getting messy.
Any reason ?
Reply


Messages In This Thread
File format. - by Darnell - 04.09.2011, 12:26
Re: File format. - by =WoR=Varth - 04.09.2011, 12:31
Re: File format. - by Darnell - 04.09.2011, 12:33
Re: File format. - by Improvement™ - 04.09.2011, 12:36
Re: File format. - by =WoR=Varth - 04.09.2011, 12:37
Re: File format. - by Darnell - 04.09.2011, 12:39
Re: File format. - by Jack_Leslie - 04.09.2011, 12:42
Re: File format. - by Darnell - 04.09.2011, 12:45
Re: File format. - by Jack_Leslie - 04.09.2011, 12:48
Re: File format. - by Darnell - 04.09.2011, 13:03

Forum Jump:


Users browsing this thread: 1 Guest(s)