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

Plutonium

  1. Home
  2. BO1 Modding Releases & Resources
  3. [ZM] B01 High Round Lock

[ZM] B01 High Round Lock

Scheduled Pinned Locked Moved BO1 Modding Releases & Resources
1 Posts 1 Posters 177 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 last edited by CUKServers
    #1

    Updated Script that locks a server on a specified round (20), A password is generated to allow friends to join in progress. Password is then removed on game death

    https://github.com/CoreyUK/T5-scripts/blob/main/Roundlock.gsc

    #include common_scripts\utility;
    #include maps\_utility;
    
    main()
    {
        level thread setPasswordsOnRound(20);
        level.locked = false;
    
        
        level thread resetPasswordOnEnd();
    }
    
    setPasswordsOnRound(roundNumber)
    {
        level endon("disconnect");
    
        while (true)
        {
            level waittill("between_round_over");
            if (level.round_number >= roundNumber)
            {
                level.locked = true;
                pin = generateString();
                setDvar("g_password", pin);
                setDvar("password", pin);
    
                level thread messageRepeat("^2Server is now locked. Use password ^1" + pin + " ^2to rejoin.");
                break;
            }
        }
    }
    
    messageRepeat(message)
    {
        level endon("disconnect");
    
        while (true)
        {
            iPrintLn(message);
            level waittill("between_round_over");
        }
    }
    
    generateString()
    {
        str = "";
    
        for (i = 0; i < 4; i++)
        {
            str = str + randomInt(10);
        }
    
        return str;
    }
    
    resetPasswordOnEnd()
    {
        level endon("disconnect");
    
        
        level waittill("end_game");
    
        
        setDvar("g_password", "");
        setDvar("password", "");
       // iPrintLn("^2Server password has been cleared.");
    }
    
    
    1 Reply Last reply
    1
    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