14.05.2014, 19:58
pawn Код:
public SaveToFile(filename[],text[]){
#if defined SAVE_LOGS
new File:File filepath[128], string[128], year,month,day, hour,minute,second;
getdate(year,month,day); gettime(hour,minute,second);
format(filepath,sizeof(filepath),"Thepath/%s.txt",filename);
File = fopen(filepath,io_append);
format(string,sizeof(string),"[%d.%d.%d %d:%d:%d] %s\r\n",day,month,year,hour,minute,second,text);
fwrite(File,string);
fclose(File);
#endif
return 1;}
PHP код:
SaveToFile("Reports",string);