need help with saving a file (+rep)
#1

Hello,i have this kinda system.it saves the settings, but when it saves it creates new numbers,not edit the old ones,how to make it edit the old one what is already saved?

pawn Код:
public SaveSettings()
{
        new File: file2;
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%d|%d|%d|%d|%d|%d|%d|",
        Settings[Tax],
        Settings[SFPDpc],
        Settings[FBIpc],
        Settings[EMSpc],
        Settings[FIREpc],
        Settings[hBill],
        Settings[GovCash]);
        file2 = fopen("MPRP/Settings.cfg", io_append);
        fwrite(file2, coordsstring);
        fclose(file2);
        return 1;
}
Reply
#2

Try using dini its very simple and best to work..here is the link https://sampforum.blast.hk/showthread.php?tid=50 and help link here https://sampwiki.blast.hk/wiki/Useful_Fu....28Dini.inc.29
or with the same type you posted use io_write. it will overwrite the file
Reply
#3

Quote:
Originally Posted by Harish
Посмотреть сообщение
Try using dini its very simple and best to work..here is the link https://sampforum.blast.hk/showthread.php?tid=50 and help link here https://sampwiki.blast.hk/wiki/Useful_Fu....28Dini.inc.29
or with the same type you posted use io_write. it will overwrite the file
Think before posting, dini is old, compare dini to latest ini saving system. everyone votes that dini is slow.
try changing io_append to io_write
Reply
#4

Quote:
Originally Posted by Reklez
Посмотреть сообщение
Think before posting, dini is old, compare dini to latest ini saving system. everyone votes that dini is slow.
try changing io_append to io_write
Lol at this post - It's easier to write with dini for beginners. I believe it's good enough in that perspective.
Reply
#5

In my server i'm using dini that's why i posted.sorry if i make any mistakes..thanks for your reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)