Skip to content
  • 0 Unread 0
  • 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 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Lemon Online
    Lemon Online
    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?

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

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

      Lemon 1 Reply Last reply
      0
      • Xerxes Xerxes

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

        Lemon Online
        Lemon Online
        Lemon
        Contributor
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • Lemon Lemon

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

          Kalitos Offline
          Kalitos Offline
          Kalitos
          wrote 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();
          }
          K7L5 Resxt 2 Replies Last reply
          0
          • Kalitos Kalitos

            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();
            }
            K7L5 Offline
            K7L5 Offline
            K7L5
            wrote on last edited by
            #5

            Kalitos said in Auto server restart:

            ead onPlayerConnect();
            }

            1 Reply Last reply
            0
            • Kalitos Kalitos

              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();
              }
              Resxt Online
              Resxt Online
              Resxt
              Plutonium Staff
              wrote on last edited by
              #6

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

              Kalitos 1 Reply Last reply
              0
              • Resxt Resxt

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

                Kalitos Offline
                Kalitos Offline
                Kalitos
                wrote 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

                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
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

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