21.06.2016, 16:04
It's crashing on fwrite so maybe the file doesn't exist try this...
PHP код:
WriteLogs(const playername[], file[30], const author[], const reason[], const other[])
{
static day, month, hour, minute, seconde, year, stringW[190];
if(strfind(file, ".log", false, 0) == -1) format(file, sizeof(file), "%s.log", file);
format(file, sizeof(file), "/Logs/%s", file);
if(!fexist(file)) {
new File:pos=fopen(file, io_write);
fclose(pos);
}
new File:pos=fopen(file, io_append);
gettime(hour, minute, seconde);
getdate(year, month, day);
format(stringW,sizeof(stringW),"\r\n[%02i/%02i/%02i] %02i:%02i:%02i | %s %s %s : %s", day, month, year, hour, minute, seconde, author, reason, playername, other);
fwrite(pos,stringW);
fclose(pos);
}