Auto server restart
-
anyone know how i can make a bat where when a game finishes it will close the exe and open it again?
-
The example server configs already contain bat files that do just that.
-
Xerxes hmm, i leave them open but the servers never close and restart
-
Lemonn_ It's not a bat file, but with this script every time the server goes empty it will automatically reboot. You need to use a plugin for the "quit" command to work, and work with the "autorestart" bat file. It is a matter of modifying it if you want it to restart every time a game ends. Because if the server runs out of players, the game will automatically restart.
#include maps\mp\zombies\_zm_utility; #include common_scripts\utility; init() { level thread onPlayerConnect(); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onplayerdisconnect(); } } restartserver() { players = get_players(); if(players.size == 0) { executecommand("quit"); return 0; } } onplayerdisconnect() { level endon("game_ended"); self waittill("disconnect"); wait(3); restartserver(); }
-
Kalitos said in Auto server restart:
ead onPlayerConnect();
} -
Kalitos why do you call restartserver() when a player connects?
-
Resxt At the time, I copied it from the forum. I currently don't use it. I had it saved.