zcmd - command log write to other file
#2

Just do sth like this:

Код:
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);
}
Then it safes under /scriptfiles/CMD_LOG.log the cmd log
Reply


Messages In This Thread
zcmd - command log write to other file - by Camorra - 19.03.2015, 08:55
AW: zcmd - command log write to other file - by Kaliber - 19.03.2015, 09:04
Re: zcmd - command log write to other file - by Camorra - 19.03.2015, 09:26
AW: Re: zcmd - command log write to other file - by Kaliber - 19.03.2015, 09:28
Re: zcmd - command log write to other file - by Camorra - 19.03.2015, 09:31
AW: Re: zcmd - command log write to other file - by Kaliber - 19.03.2015, 09:52
Re: zcmd - command log write to other file - by Camorra - 19.03.2015, 10:13

Forum Jump:


Users browsing this thread: 1 Guest(s)