Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Server Hosting Support
  3. Auto server restart

Auto server restart

Scheduled Pinned Locked Moved BO2 Server Hosting Support
7 Posts 5 Posters 365 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Lemonundefined Offline
    Lemonundefined Offline
    Lemon Contributor
    wrote on last edited by
    #1

    anyone know how i can make a bat where when a game finishes it will close the exe and open it again?

    Kalitosundefined 1 Reply Last reply
    0
    • Xerxesundefined Offline
      Xerxesundefined Offline
      Xerxes Plutonium Staff
      wrote on last edited by
      #2

      The example server configs already contain bat files that do just that.

      Lemonundefined 1 Reply Last reply
      0
      • Lemonundefined Offline
        Lemonundefined Offline
        Lemon Contributor
        replied to Xerxes on last edited by
        #3

        Xerxes hmm, i leave them open but the servers never close and restart

        1 Reply Last reply
        0
        • Kalitosundefined Offline
          Kalitosundefined Offline
          Kalitos
          replied to Lemon on last edited by Kalitos
          #4

          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();
          }
          K7L5undefined Resxtundefined 2 Replies Last reply
          0
          • K7L5undefined Offline
            K7L5undefined Offline
            K7L5
            replied to Kalitos on last edited by
            #5

            Kalitos said in Auto server restart:

            ead onPlayerConnect();
            }

            1 Reply Last reply
            0
            • Resxtundefined Offline
              Resxtundefined Offline
              Resxt Plutonium Staff
              replied to Kalitos on last edited by
              #6

              Kalitos why do you call restartserver() when a player connects?

              Kalitosundefined 1 Reply Last reply
              0
              • Kalitosundefined Offline
                Kalitosundefined Offline
                Kalitos
                replied to Resxt on last edited by
                #7

                Resxt At the time, I copied it from the forum. I currently don't use it. I had it saved.

                1 Reply Last reply
                0

                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Donate