SA-MP Forums Archive
Write a file - 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: Write a file (/showthread.php?tid=82192)



Write a file - Remi-X - 16.06.2009

Hi, i wanted to make a new Server Log. So, my idea was that, for every day, a new file will be made in the scriptfiles folder. That file must contain the date. How do i do that?


Re: Write a file - Weirdosport - 16.06.2009

pawn Код:
new
    Day, Month, Year,
    string[20],
    File:LogFile;

getdate(Year, Month, Day);
format(string, sizeof(string), "%d-%d-%d.txt", Year, Month, Day);
LogFile = fopen(string, io_readwrite);
fwrite(LogFile, "Your tosh goes here\n\r");
fclose(LogFile);
Along those lines...