Issue with command logging.
#1

So. Recently. I decided to make a basic command log, and for some reason it keeps outputting like this

Код:
UnholyBeast(0) has used the command /test.UnholyBeast(0) has used the command /test.
Here's the code

Код:
CMD:test(playerid, params[])
{
	new log_string[144];
	format(log_string, sizeof(log_string), "%s(%d) has used the command /test.", PlayerName(playerid), playerid);
	SendCommandToLog(log_string);
	return 1;
}

stock SendCommandToLog(command_string[])
{
	new File:cmd_log = fopen("/server_files/command_log.txt", io_append);
	fwrite(cmd_log, command_string);
        fwrite(cmd_log, "\n");
	fclose(cmd_log);
	return 1;
}
Not sure if it has something to do with the way fwrite was made, or if I am just using it incorrectly.
Reply


Messages In This Thread
Issue with command logging. - by UnholyBeast - 12.10.2016, 20:32
Re: Issue with command logging. - by Konstantinos - 12.10.2016, 20:44
Re: Issue with command logging. - by UnholyBeast - 12.10.2016, 21:27

Forum Jump:


Users browsing this thread: 3 Guest(s)