SA-MP Forums Archive
On server closing or opening the server_log.txt get auto reset? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: On server closing or opening the server_log.txt get auto reset? (/showthread.php?tid=601775)



On server closing or opening the server_log.txt get auto reset? - xEF - 26.02.2016

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.


Re: On server closing or opening the server_log.txt get auto reset? - ]Rafaellos[ - 26.02.2016

What do you mean logs lag? I never had that issue before.


Re: On server closing or opening the server_log.txt get auto reset? - xEF - 26.02.2016

That's not an issue, that's a function question.
I want to clear the server log while server closing or opening


Re: On server closing or opening the server_log.txt get auto reset? - SyS - 26.02.2016

Quote:
Originally Posted by xEF
Посмотреть сообщение
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


Re: On server closing or opening the server_log.txt get auto reset? - AmigaBlizzard - 26.02.2016

Make a .bat file to do both.

PHP код:
@echo off
del server_log
.txt /q
samp
-server.exe 
Save this in your server directory as "StartServer.bat", then double-click it.


Re: On server closing or opening the server_log.txt get auto reset? - Sascha - 27.02.2016

Or just clear the log at "OnGameModeInit" by using the io_write method
https://sampwiki.blast.hk/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;
}