String/Log Question
#1

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[]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)