SA-MP Forums Archive
Command logging - 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: Command logging (/showthread.php?tid=261382)



Command logging - newarvuti - 13.06.2011

Hey!

Right now, my server just logs the regular chat into the server console and server_log.txt file.
I want to log every command and text with parametres to another file.
I'm using zcmd and sscanf for commands.

Currently I can only see, that possible way to make a log for commands, is to create a log file and add a piece of code to every command, that would send the command with parametres to the file.

Is there any other way?


Re: Command logging - CaHbKo - 13.06.2011

pawn Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    printf("[CMD]%s |%s|%d", PlayerName(playerid), cmdtext, success);
    return 1;
}
This prints it to the server_log.txt. Feel free to modify it as you wish.


Re: Command logging - newarvuti - 13.06.2011

Thanks, works great.