20.03.2015, 19:16
Consegui usando assim:
Код:
//OnPlayerText format(string, sizeof(string), "%s: %s.", getPName(playerid), text); WriteLog("chat", string); //OnPlayerCommandPerformed format(string, sizeof(string), "%s: %s.", getPName(playerid), cmdtext); WriteLog("cmds", string); // stock WriteLog(filename[],text[]) { printf(text); new File:file; new filepath[256], string[128], year,day,month, hour,minute,second; getdate(year,day,month); gettime(hour,minute,second); format(filepath,sizeof(filepath),"FV/logs/%s.log",filename); file = fopen(filepath,io_append); format(string,sizeof(string),"[%02d/%02d/%d|%02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text); fwrite(file,string); fclose(file); return 1; }