SA-MP Forums Archive
how to create logs per player? - 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)
+--- Thread: how to create logs per player? (/showthread.php?tid=458472)



how to create logs per player? - Kapone21 - 16.08.2013

I want to create a log for all all players in a folder named "PlayersLogs" and on him to appear name of player for example:
Scriptfiles/PlayerLogs/NAME_PLAYER1/LOG.info
Scriptfiles/PlayerLogs/NAME_PLAYER2/LOG.info etc.
i have these example
Код:
public PayLog(string[])
{
	new entry[256];
	format(entry, sizeof(entry), "%s\n",string);
	new File:hFile;
	hFile = fopen("pay.log", io_append);
	fwrite(hFile, entry);
	fclose(hFile);
}
I want the log to look like
[10:00 *to get the hour* ] Blabla log here i know to store logs but no how per player and hour...



Questions:

1.How to make per player
2.I can make with hour ? to get the hour from server.. ?


Re: how to create logs per player? - Scenario - 16.08.2013

Believe me, it isn't worth doing this per player. LSRP has hundreds of thousands (if not MILLIONS) of users. You don't want to have to sift through 300,000 files- it's not worth the space it would consume.

Use gettime to retrieve the current hour, minute, and second.