Saving logs fastly
#7

Quote:
Originally Posted by zDivine
Посмотреть сообщение
No, creating a stock will not require a timer. I don't know what you're talking about...

Anyways, you can make a stock, such as

Код:
Log(sz_fileName[], sz_input[]) {

	new
	sz_logEntry[156],
	i_dateTime[2][3],
	File: fileHandle = fopen(sz_fileName, io_append);

	gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
	getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);

	format(sz_logEntry, sizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
	fwrite(fileHandle, sz_logEntry);
	return fclose(fileHandle);
}
Then use:

Код:
new log[256];
format(log, sizeof(log), "Message here.");
Log("logs/test.log", log);
* This was taken from another script, as I didn't feel like writing this up myself when I could just get it form this. Hope this helps.
Nice one , but still have one question : the [256] is the Length of the string(format) or all the file (log)? cuz we don't know fo example if the Bans log will be only 256.

thanks.

NB : use [ PAWN] [/ PAWN] .
Reply


Messages In This Thread
Saving logs fastly - by Saw® - 11.04.2013, 21:46
Re: Saving logs fastly - by park4bmx - 11.04.2013, 21:53
Re: Saving logs fastly - by zDivine - 11.04.2013, 21:59
Re: Saving logs fastly - by Saw® - 11.04.2013, 21:59
Re: Saving logs fastly - by zDivine - 11.04.2013, 22:01
Re: Saving logs fastly - by park4bmx - 11.04.2013, 22:05
Re: Saving logs fastly - by Saw® - 11.04.2013, 22:07
Re: Saving logs fastly - by zDivine - 11.04.2013, 22:09
Re: Saving logs fastly - by park4bmx - 11.04.2013, 22:11
Re: Saving logs fastly - by Saw® - 11.04.2013, 22:20

Forum Jump:


Users browsing this thread: 2 Guest(s)