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

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Release] (T6ZM) Prevent Players Joining In-Progress After Rounds

[Release] (T6ZM) Prevent Players Joining In-Progress After Rounds

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
9 Posts 4 Posters 811 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.
  • CUKServersundefined Offline
    CUKServersundefined Offline
    CUKServers
    wrote on last edited by
    #1

    Quick script that kicks any people who join after the defined round.

    https://github.com/CoreyUK/T6ZM-Scripts/blob/main/Join-in-progress-script/PostRoundLock.gsc

    JezuzLizardundefined 1 Reply Last reply
    2
    • CUKServersundefined CUKServers

      Quick script that kicks any people who join after the defined round.

      https://github.com/CoreyUK/T6ZM-Scripts/blob/main/Join-in-progress-script/PostRoundLock.gsc

      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by
      #2

      CUKServers Alternatively, and probably better than kicking random players from your server would be to set a password on the server. You can do this by setting the dvar g_password to some value that no one can guess and then setting it to blank when the game ends.

      CUKServersundefined 1 Reply Last reply
      1
      • JezuzLizardundefined JezuzLizard

        CUKServers Alternatively, and probably better than kicking random players from your server would be to set a password on the server. You can do this by setting the dvar g_password to some value that no one can guess and then setting it to blank when the game ends.

        CUKServersundefined Offline
        CUKServersundefined Offline
        CUKServers
        wrote on last edited by
        #3

        JezuzLizard these servers are hosted publicly and I wish for everyone to have access to them, having this script prevents people interrupting an ongoing EE Run or something of that nature, when more players join a game it changes zombie count which a new player can’t possibly pick up the slack as there starting with a pistol. I’d love to have password only servers but nobody is interested in joining a discord for the password so they can remain uninterrupted

        chicken emojiundefined 1 Reply Last reply
        0
        • CUKServersundefined CUKServers

          JezuzLizard these servers are hosted publicly and I wish for everyone to have access to them, having this script prevents people interrupting an ongoing EE Run or something of that nature, when more players join a game it changes zombie count which a new player can’t possibly pick up the slack as there starting with a pistol. I’d love to have password only servers but nobody is interested in joining a discord for the password so they can remain uninterrupted

          chicken emojiundefined Offline
          chicken emojiundefined Offline
          chicken emoji
          wrote on last edited by
          #4

          CUKServers You can set the password midgame and then remove it when the game ends it also updates it in the server list so you know as a player if youre supposed to be able to join a server or not

          CUKServersundefined 1 Reply Last reply
          0
          • chicken emojiundefined chicken emoji

            CUKServers You can set the password midgame and then remove it when the game ends it also updates it in the server list so you know as a player if youre supposed to be able to join a server or not

            CUKServersundefined Offline
            CUKServersundefined Offline
            CUKServers
            wrote on last edited by
            #5

            chicken emoji ahh i see i miss understood, i'll give that a try when i have sometime

            1 Reply Last reply
            0
            • CUKServersundefined Offline
              CUKServersundefined Offline
              CUKServers
              wrote on last edited by
              #6

              EDIT: Changed following JezuzLizard comment, Now uses a set round to trigger a lock on the server which is reset when game ends 😃

              Cheers

              JezuzLizardundefined 1 Reply Last reply
              0
              • Mr. Androidundefined Offline
                Mr. Androidundefined Offline
                Mr. Android
                Plutonium Admin
                wrote on last edited by
                #7

                Great release, I tweeted this as it could be useful for people.

                1 Reply Last reply
                1
                • CUKServersundefined CUKServers

                  EDIT: Changed following JezuzLizard comment, Now uses a set round to trigger a lock on the server which is reset when game ends 😃

                  Cheers

                  JezuzLizardundefined Offline
                  JezuzLizardundefined Offline
                  JezuzLizard
                  Plutonium Staff
                  wrote on last edited by
                  #8

                  CUKServers As funny as that password is, if someone learns that the password is hardcoded to be that they can join anyway.

                  you can use this simple function to generate a random pin

                  generate_random_password()
                  {
                  	str = "";
                  	for ( i = 0; i < 4; i++ )
                  	{
                  		str = str + randomInt( 10 );
                  	}
                  	return str;
                  }
                  

                  Additionally, you can use setClientDvar() on all clients in the server with the password dvar set to that pin, and tell clients in the game the password. This way if a client gets disconnected they can still join back if they didn't close their game or they remember the password.

                  Heres what this would look like

                  	pin = generate_random_password();
                  	setDvar( "g_password", pin );
                  
                  	players = getPlayers();
                  	for ( i = 0; i < players.size; i++ )
                  	{
                  		players[ i ] setClientDvar( "password", pin );
                                  players[ i ] iPrintLn( "Server is now locked use " + pin + " password to rejoin" );
                  	}
                  
                  CUKServersundefined 1 Reply Last reply
                  0
                  • JezuzLizardundefined JezuzLizard

                    CUKServers As funny as that password is, if someone learns that the password is hardcoded to be that they can join anyway.

                    you can use this simple function to generate a random pin

                    generate_random_password()
                    {
                    	str = "";
                    	for ( i = 0; i < 4; i++ )
                    	{
                    		str = str + randomInt( 10 );
                    	}
                    	return str;
                    }
                    

                    Additionally, you can use setClientDvar() on all clients in the server with the password dvar set to that pin, and tell clients in the game the password. This way if a client gets disconnected they can still join back if they didn't close their game or they remember the password.

                    Heres what this would look like

                    	pin = generate_random_password();
                    	setDvar( "g_password", pin );
                    
                    	players = getPlayers();
                    	for ( i = 0; i < players.size; i++ )
                    	{
                    		players[ i ] setClientDvar( "password", pin );
                                    players[ i ] iPrintLn( "Server is now locked use " + pin + " password to rejoin" );
                    	}
                    
                    CUKServersundefined Offline
                    CUKServersundefined Offline
                    CUKServers
                    wrote on last edited by
                    #9

                    JezuzLizard Added to script👍

                    1 Reply Last reply
                    0
                    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
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Donate