SA-MP Forums Archive
[SOLVED] Create log - 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: [SOLVED] Create log (/showthread.php?tid=88225)



[SOLVED] Create log - kevin974 - 25.07.2009

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);


Re: Create log - kevin974 - 25.07.2009

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);



Re: Create log - abhinavdabral - 25.07.2009

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

-Abhinav