SA-MP Forums Archive
sa-mp auto server crash restarter - 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: sa-mp auto server crash restarter (/showthread.php?tid=190528)



sa-mp auto server crash restarter - audifan00 - 15.11.2010

hello,
1. Yes i did search.

i found a restarter exactly what i need that if server crashes it auto start's it again.
BUT i run 5 servers, and if i add that program to all 5 it will only for for 1 because it checks that "samp-server.exe" is already in processes, and if i rename other server's exe's to "example.exe" or something, that program will just say "samp-server.exe not found"

So i kinda need a restarter but for multiple servers


thank you


Re: sa-mp auto server crash restarter - <Weponz> - 15.11.2010

doesnt it automatically restart when it crashes? xD


Re: sa-mp auto server crash restarter - Scenario - 15.11.2010

Do you need this for Linux, or Windows?


Re: sa-mp auto server crash restarter - audifan00 - 15.11.2010

i need it for windows


Re: sa-mp auto server crash restarter - audifan00 - 16.11.2010

anyone?...........


Re: sa-mp auto server crash restarter - Sinner - 16.11.2010

http://forum.sa-mp.com/showthread.ph...t=auto+restart
That does gmx though (only reloads, so not a full restart)

Otherwise make a .Bat file that continually runs samp.exe


Re: sa-mp auto server crash restarter - audifan00 - 16.11.2010

eh i dont think it is exactly what i want...
also if anyone here is good with php?
i got php control panel and its up and running, i just dont know how to link servers to the control panel..
if anyone can help me i will pay them...


Re: sa-mp auto server crash restarter - audifan00 - 16.11.2010

or how do i make a bat file that will detect if server closed and re-open it?


Re: sa-mp auto server crash restarter - JaTochNietDan - 16.11.2010

What program do you use for that?

Here's a the source of a .bat file you could use, it was made by yom.

Код:
@ECHO OFF
TITLE Yom's SA-MP server restarter
COLOR 09

SET option_log=0

SET folder=restarter
SET file_1=server_log.txt
SET file_2=%folder%\server.log
SET file_3=%folder%\restarter.log
SET file_4=%folder%\reset.reg
SET server=samp-server.exe
SET count=0
SET regkey="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug"



IF NOT EXIST %server% (

	COLOR 0C
	ECHO %server% was not found!
	ECHO Press any key to exit.
	PAUSE > NUL
	GOTO EOF
)



IF NOT EXIST %folder% MD %folder%



IF NOT EXIST %file_4% (

	REG EXPORT %regkey% %file_4% > NUL
	REG ADD %regkey% /V Auto /D 1 /F > NUL
	REG ADD %regkey% /V Debugger /D 0 /F > NUL
)



:START

	CLS & ECHO.

	SET hh=%time:~0,2%

	IF %hh% LSS 10 SET hh=0%time:~1,1%

	SET msg=[%date%][%hh%:%time:~3,5%] Server

	IF %count% EQU 0 (SET msg=%msg% started.) ELSE SET msg=%msg% restarted [%count%x].

	ECHO  %msg% & ECHO %msg%>> %file_3%

	IF %option_log% EQU 1 (

		ECHO %msg%>> %file_2%
		TYPE %file_1%>> %file_2%
		FOR /L %%i IN (1,1,4) DO ECHO.>> %file_2%
	)

	GOTO NEXT



:NEXT

	SET /A count+=1
	CALL %server%
	GOTO START



:EOF
So when you re-name samp-server.exe for each server, just change this part of the .bat source

SET server=samp-server.exe


Re: sa-mp auto server crash restarter - audifan00 - 16.11.2010

its kinda perfect, but it always asks "terminate y n"

Is it possible so that it will auto start and not ask?