PDA

View Full Version : On server closing or opening the server_log.txt get auto reset?


xEF
26/02/2016, 12:29 PM
As the answer title, is possible to make a function every time that the server closes or opens the server_log.txt get cleared automatically, to avoid logs lag?

Regards.

]Rafaellos[
26/02/2016, 12:36 PM
What do you mean logs lag? I never had that issue before.

xEF
26/02/2016, 12:39 PM
That's not an issue, that's a function question.
I want to clear the server log while server closing or opening

SyS
26/02/2016, 01:45 PM
That's not an issue, that's a function question.
I want to clear the server log while server closing or opening

dont start your server :D

AmigaBlizzard
26/02/2016, 08:43 PM
Make a .bat file to do both.


@echo off
del server_log.txt /q
samp-server.exe


Save this in your server directory as "StartServer.bat", then double-click it.

Sascha
27/02/2016, 09:15 AM
Or just clear the log at "OnGameModeInit" by using the io_write method
http://wiki.sa-mp.com/wiki/Fopen

public OnGameModeInit()
{
new File:log = fopen("YourlogFile.txt", io_write);
fwrite(log, "---- Log File Cleared ----"); //you can leave this out if you want
fclose(log);
//rest of your cdode
return 1;
}