[SOLVED] Create log
#1

Well this is come coding i have done
Код:
stock CreateLog(fname[], string[], {float,_}:...)
{
	new str[256], File:hfile;
	format(str, sizeof(str), string);
	hfile = fopen(fname, io_append);
	fwrite(hfile, str);
	fclose(hfile);
}
I want it so i can do something like this.

CreateLog("test1.log", "%s %s\r\n", GetServerTime(), string);
Reply
#2

I fixed the problem. Am posting it encase anyone else needs it.

Код:
new FALSE = false;
#define CreateLog(%0,%1) do{new _str[256], File:hfile; format(_str, sizeof(_str), %1); hfile = fopen(%0, io_append); fwrite(hfile, _str); fclose(hfile);}while(FALSE)
Use it like this:
Код:
new var1 = "Hello";
CreateLog("TestingLog.log", "%s", var1);
Reply
#3

Nice,
Also Change the Topic To [SOLVED] Create Log

-Abhinav
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)