08.04.2018, 17:13
PHP код:
forward SaveLogs(filename[], text[]);
public SaveLogs(filename[], text[])
{
new File:file,
line[256],
string[256];
new year, month, day;
getdate(year, month, day);
format(line, sizeof(line), "Logs/%s.txt", filename);
file = fopen(line, io_append);
format(string, sizeof(string), "[%02d/%02d/%02d] %s\r\n", day, month, year, text);
fwrite(file, string);
fclose(file);
return 1;
}