SA-MP Forums Archive
String/Log Question - 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: String/Log Question (/showthread.php?tid=85007)



String/Log Question - acade - 04.07.2009

Hey, I was wondering if it is possible to log every command a player types and place it into a log file.

So far, I've done:

Код:
public Commands(string[])
{
	new entry[256];
	format(entry, sizeof(entry), "%s\r\n",string);
	new File:hFile;
	hFile = fopen("CRP_Scriptfiles/Logs/cmds.log", io_append);
	fwrite(hFile, entry);
	fclose(hFile);
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	new tmp[256];
	new giveplayerid;
	
	if(gPlayerLogged[playerid] == 1)
  Commands(string);
	{
To show where I put it

Код:
forward Commands(string[]);
Код:
forward Commands(string[]);