19.03.2015, 09:04
Just do sth like this:
Then it safes under /scriptfiles/CMD_LOG.log the cmd log
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new string[128]; GetPlayerName(playerid, string, MAX_PLAYER_NAME); format(string,128,"%s (%d): %s",string,playerid,cmdtext); file_set_content("CMD_LOG.log",string); } stock file_set_content(const path[], string[]) { new File:f = fopen(path,io_append),h[6]; gettime(h[0],h[1],h[2]),getdate(h[3],h[4],h[5]); format(string,128,"[%02d.%02d.%02d - %02d:%02d:%02d] %s\r\n",h[5],h[4],h[3],h[0],h[1],h[2],string); return fwrite(f,string),fclose(f); }
