SA-MP Forums Archive
fwrite help!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: fwrite help!! (/showthread.php?tid=150711)



fwrite help!! - Jokerstyle - 27.05.2010

K title says it.
I need help.
What I want to do:

I'm using this:
pawn Код:
IRCCMD:suggest(botid, channel[], user[], host[], params[])
{
    new msg[512];
    format(msg, sizeof(msg), "[%s]: %s\r\n", user, params);
    new msg2[32];
    format(msg2, sizeof(msg2), "/suggestions/%s.txt", user);
    new File:example = fopen(msg2, io_write);
    fwrite(example, msg);
    fclose(example);
    format(msg, sizeof(msg), "4Suggestion sent! Please be patient, an admin will contact you soon!");
    IRC_GroupSay(gGroupID, channel, msg);
    return 1;
}
to save things.

But when a user types the command to times, it always overwrites the old thing.
How to make it that it always start a line below the old one?


Re: fwrite help!! - MummyKillerSLO - 27.05.2010

Use io_append instead of io_write