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 302 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.
  • undefined Offline
    undefined Offline
    Lemon Contributor
    wrote on Sep 1, 2023, 3:49 PM 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?

    undefined 1 Reply Last reply Sep 1, 2023, 9:44 PM
    0
    • undefined Offline
      undefined Offline
      Xerxes Plutonium Staff
      wrote on Sep 1, 2023, 5:01 PM last edited by
      #2

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

      undefined 1 Reply Last reply Sep 1, 2023, 6:26 PM
      0
      • undefined Offline
        undefined Offline
        Lemon Contributor
        replied to Xerxes on Sep 1, 2023, 6:26 PM last edited by
        #3

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

        1 Reply Last reply
        0
        • undefined Offline
          undefined Offline
          Kalitos
          replied to Lemon on Sep 1, 2023, 9:44 PM last edited by Kalitos Sep 2, 2023, 3:26 AM
          #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();
          }
          undefined undefined 2 Replies Last reply Sep 1, 2023, 10:04 PM
          0
          • undefined Offline
            undefined Offline
            K7L5
            replied to Kalitos on Sep 1, 2023, 10:04 PM last edited by
            #5

            Kalitos said in Auto server restart:

            ead onPlayerConnect();
            }

            1 Reply Last reply
            0
            • undefined Offline
              undefined Offline
              Resxt Plutonium Staff
              replied to Kalitos on Sep 1, 2023, 10:19 PM last edited by
              #6

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

              undefined 1 Reply Last reply Sep 2, 2023, 12:09 AM
              0
              • undefined Offline
                undefined Offline
                Kalitos
                replied to Resxt on Sep 2, 2023, 12:09 AM 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

                4/7

                Sep 1, 2023, 9:44 PM

                • Login

                • Don't have an account? Register

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