Issues writing to files
#1

I made a logging function for one of my scripts:
pawn Код:
public WriteToLogFile(string[])
{
    new Hour, Minute, Second, Year, Month, Day;
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);
    LogFile = fopen("ACLog.txt", io_append);
    new logstring[256];
    format(logstring, sizeof(logstring), "[%s-%s-%s at %s:%s:%s] %s \r\n", Year, Month, Day, Hour, Minute, Second, string);
    fwrite(LogFile, string);
    fclose(LogFile);
}
Only issue with it is that it isn't including the date or time, nor is it putting the nest string on the next line.
What's wrong with it?

EDIT: I kicked myself from my server and I got this out of my log file:
Код:
biltong has been kicked by biltong.
That's it, nothing else. Why isn't it showing the date or time?
Reply


Messages In This Thread
Issues writing to files - by biltong - 28.03.2010, 21:48
Re: Issues writing to files - by Jefff - 29.03.2010, 00:02
Re: Issues writing to files - by Mystique - 29.03.2010, 07:12
Re: Issues writing to files - by [gmR]BarMaN - 29.03.2010, 07:26
Re: Issues writing to files - by biltong - 29.03.2010, 08:14
Re: Issues writing to files - by biltong - 29.03.2010, 11:52
Re: Issues writing to files - by Mikep. - 29.03.2010, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)