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
#2

Similar problem: https://sampforum.blast.hk/showthread.php?pid=3780893#pid3780893
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)