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
-
anyone know how i can make a bat where when a game finishes it will close the exe and open it again?
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(); } -
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();
} -
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 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login