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
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
After searching for a script that could track and save the highest round records for each player count (solo, duo, trio, and 4-player teams), I came across an older script from 2020: ZM Highest Round Tracker. which I have used as a reference for this script as it had become outdated. This script requires T6 utils https://github.com/alicealys/t6-gsc-utils
Script can be found below or at my github: https://github.com/CoreyUK/T6ZM-Scripts/blob/main/RoundSaver/CUKRoundSaver.gsc
I'm no GSC god so don't expect too much from me 

#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes_zm\_hud_util;
#include maps\mp\gametypes_zm\_hud_message;
init()
{
level.highRoundOnePlayer = 0;
level.highRoundTwoPlayers = 0;
level.highRoundThreePlayers = 0;
level.highRoundFourPlayers = 0;
level.highRoundPlayersOne = "None";
level.highRoundPlayersTwo = "None";
level.highRoundPlayersThree = "None";
level.highRoundPlayersFour = "None";
level thread high_round_tracker();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connected", player);
player thread high_round_info();
}
}
high_round_tracker()
{
thread high_round_info_giver();
gamemode = gamemodeName( getDvar( "ui_gametype" ) );
map = mapName( level.script );
if( level.script == "zm_transit" && getDvar( "ui_gametype" ) == "zsurvival" )
map = startLocationName( getDvar( "ui_zm_mapstartlocation" ) );
//file handling//
level.basepath = getDvar("fs_homepath") + "/";
path = level.basepath + "/logs/" + map + gamemode + "HighRound.txt";
file = fopen(path, "r");
text = fread(file);
fclose(file);
//end file handling//
highroundinfo = strToK( text, ";" );
if ( highroundinfo.size >= 8 )
{
level.highRoundOnePlayer = int( highroundinfo[ 0 ] );
level.highRoundTwoPlayers = int( highroundinfo[ 1 ] );
level.highRoundThreePlayers = int( highroundinfo[ 2 ] );
level.highRoundFourPlayers = int( highroundinfo[ 3 ] );
level.highRoundPlayersOne = highroundinfo[ 4 ];
level.highRoundPlayersTwo = highroundinfo[ 5 ];
level.highRoundPlayersThree = highroundinfo[ 6 ];
level.highRoundPlayersFour = highroundinfo[ 7 ];
}
else
{
level.highRoundOnePlayer = 0;
level.highRoundTwoPlayers = 0;
level.highRoundThreePlayers = 0;
level.highRoundFourPlayers = 0;
level.highRoundPlayersOne = "None";
level.highRoundPlayersTwo = "None";
level.highRoundPlayersThree = "None";
level.highRoundPlayersFour = "None";
}
for ( ;; )
{
level waittill ( "end_game" );
players = get_players();
numPlayers = players.size;
if ( numPlayers == 1 && level.round_number > level.highRoundOnePlayer )
updateHighRoundRecord(1, players);
else if ( numPlayers == 2 && level.round_number > level.highRoundTwoPlayers )
updateHighRoundRecord(2, players);
else if ( numPlayers == 3 && level.round_number > level.highRoundThreePlayers )
updateHighRoundRecord(3, players);
else if ( numPlayers == 4 && level.round_number > level.highRoundFourPlayers )
updateHighRoundRecord(4, players);
}
}
updateHighRoundRecord( numPlayers, players )
{
level.highRoundPlayers = "";
for ( i = 0; i < players.size; i++ )
{
if( level.highRoundPlayers == "" )
level.highRoundPlayers = players[i].name;
else
level.highRoundPlayers = level.highRoundPlayers + ", " + players[i].name;
}
if( numPlayers == 1 )
{
level.highRoundOnePlayer = level.round_number;
level.highRoundPlayersOne = level.highRoundPlayers;
}
else if( numPlayers == 2 )
{
level.highRoundTwoPlayers = level.round_number;
level.highRoundPlayersTwo = level.highRoundPlayers;
}
else if( numPlayers == 3 )
{
level.highRoundThreePlayers = level.round_number;
level.highRoundPlayersThree = level.highRoundPlayers;
}
else if( numPlayers == 4 )
{
level.highRoundFourPlayers = level.round_number;
level.highRoundPlayersFour = level.highRoundPlayers;
}
// Announce new record on left side, staggered
foreach( player in level.players )
{
player tell( "^1NEW RECORD!" );
wait 2;
if( numPlayers == 1 )
player tell( "^21 Player: ^1" + level.highRoundOnePlayer + " ^7(" + level.highRoundPlayersOne + ")" );
else if( numPlayers == 2 )
player tell( "^32 Players: ^1" + level.highRoundTwoPlayers + " ^7(" + level.highRoundPlayersTwo + ")" );
else if( numPlayers == 3 )
player tell( "^53 Players: ^1" + level.highRoundThreePlayers + " ^7(" + level.highRoundPlayersThree + ")" );
else if( numPlayers == 4 )
player tell( "^64 Players: ^1" + level.highRoundFourPlayers + " ^7(" + level.highRoundPlayersFour + ")" );
}
log_highround_record(
level.highRoundOnePlayer + ";" +
level.highRoundTwoPlayers + ";" +
level.highRoundThreePlayers + ";" +
level.highRoundFourPlayers + ";" +
level.highRoundPlayersOne + ";" +
level.highRoundPlayersTwo + ";" +
level.highRoundPlayersThree + ";" +
level.highRoundPlayersFour
);
}
log_highround_record( newRecord )
{
gamemode = gamemodeName( getDvar( "ui_gametype" ) );
map = mapName( level.script );
if( level.script == "zm_transit" && getDvar( "ui_gametype" ) == "zsurvival" )
map = startLocationName( getDvar( "ui_zm_mapstartlocation" ) );
level.basepath = getDvar("fs_homepath") + "/";
path = level.basepath + "/logs/" + map + gamemode + "HighRound.txt";
file = fopen( path, "w" );
fwrite( file, newRecord );
fclose( file );
}
startLocationName( location )
{
if( location == "cornfield" )
return "Cornfield";
else if( location == "diner" )
return "Diner";
else if( location == "farm" )
return "Farm";
else if( location == "power" )
return "Power";
else if( location == "town" )
return "Town";
else if( location == "transit" )
return "BusDepot";
else if( location == "tunnel" )
return "Tunnel";
}
mapName( map )
{
if( map == "zm_buried" )
return "Buried";
else if( map == "zm_highrise" )
return "DieRise";
else if( map == "zm_prison" )
return "Motd";
else if( map == "zm_nuked" )
return "Nuketown";
else if( map == "zm_tomb" )
return "Origins";
else if( map == "zm_transit" )
return "Tranzit";
return "NA";
}
gamemodeName( gamemode )
{
if( gamemode == "zstandard" )
return "Standard";
else if( gamemode == "zclassic" )
return "Classic";
else if( gamemode == "zsurvival" )
return "Survival";
else if( gamemode == "zgrief" )
return "Grief";
else if( gamemode == "zcleansed" )
return "Turned";
return "NA";
}
high_round_info_giver()
{
highroundinfo = 1;
roundmultiplier = 5;
level endon( "end_game" );
while( 1 )
{
level waittill( "start_of_round" );
if( level.round_number == ( highroundinfo * roundmultiplier ))
{
highroundinfo++;
players = get_players();
numPlayers = players.size;
foreach( player in players )
{
player tell( "^7Current High Round Record:" );
wait 2;
if( numPlayers == 1 )
player tell( "^21 Player: ^1" + level.highRoundOnePlayer + " ^7(" + level.highRoundPlayersOne + ")" );
else if( numPlayers == 2 )
player tell( "^32 Players: ^1" + level.highRoundTwoPlayers + " ^7(" + level.highRoundPlayersTwo + ")" );
else if( numPlayers == 3 )
player tell( "^53 Players: ^1" + level.highRoundThreePlayers + " ^7(" + level.highRoundPlayersThree + ")" );
else if( numPlayers == 4 )
player tell( "^64 Players: ^1" + level.highRoundFourPlayers + " ^7(" + level.highRoundPlayersFour + ")" );
}
}
}
}
high_round_info()
{
wait 6;
self tell( "^7High Round Records:" );
wait 2;
self tell( "^21 Player: ^1" + level.highRoundOnePlayer + " ^7(" + level.highRoundPlayersOne + ")" );
wait 2;
self tell( "^32 Players: ^1" + level.highRoundTwoPlayers + " ^7(" + level.highRoundPlayersTwo + ")" );
wait 2;
self tell( "^53 Players: ^1" + level.highRoundThreePlayers + " ^7(" + level.highRoundPlayersThree + ")" );
wait 2;
self tell( "^64 Players: ^1" + level.highRoundFourPlayers + " ^7(" + level.highRoundPlayersFour + ")" );
}
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 or when .unlock is used
https://github.com/CoreyUK/T5-scripts/blob/main/Roundlock.gsc
#include common_scripts\utility;
#include maps\_utility;
main()
{
// Config
level.min_lock_round = 20;
// State
level.locked = false;
level.pin = "";
level.lock_initialized = false;
// Ensure server starts unlocked
setDvar( "password", "" );
setDvar( "g_password", "" );
// Threads
level thread onPlayerConnect();
level thread roundMonitor();
// Level-scope chat listeners (T5 signature: text, player)
level thread listenForChatCommands(); // "say"
level thread listenForTeamChatCommands(); // "say_team"
// Clear password at end of game
level thread resetPasswordOnEnd();
}
onPlayerConnect()
{
for ( ;; )
{
level waittill( "connected", player );
if ( !isDefined( player ) )
continue;
// ADS + 2 input toggle
player thread monitorUnlockInput();
}
}
// Round transitions -> announce state (kill feed)
roundMonitor()
{
level endon( "disconnect" );
for ( ;; )
{
level waittill( "between_round_over" );
// First time we reach threshold -> auto-lock (silent action line)
if ( isRoundLockActive() && !level.lock_initialized )
{
level.lock_initialized = true;
level.locked = true;
level.pin = generatePin();
setDvar( "g_password", level.pin );
setDvar( "password", level.pin );
}
if ( !level.lock_initialized )
continue;
if ( level.locked )
{
if ( !isDefined( level.pin ) || level.pin == "" )
level.pin = generatePin();
setDvar( "g_password", level.pin );
setDvar( "password", level.pin );
announceAll( getLockedMessage() );
}
else
{
setDvar( "g_password", "" );
setDvar( "password", "" );
announceAll( getUnlockedMessage() );
}
}
}
// ADS + 2 to toggle
monitorUnlockInput()
{
self endon( "disconnect" );
for ( ;; )
{
if ( self adsbuttonpressed() && self ActionSlotTwoButtonPressed() )
{
setLocked( !level.locked, self );
wait( 0.4 ); // debounce
}
wait( 0.05 );
}
}
// Global chat (T5 signature: text, player)
listenForChatCommands()
{
level endon( "disconnect" );
for ( ;; )
{
level waittill( "say", text, player );
if ( !isDefined( text ) || !isDefined( player ) )
continue;
// Exact matches
if ( text == ".unlock" )
{
setLocked( false, player );
}
else if ( text == ".lock" )
{
setLocked( true, player );
}
}
}
// Team chat (T5 signature: text, player)
listenForTeamChatCommands()
{
level endon( "disconnect" );
for ( ;; )
{
level waittill( "say_team", text, player );
if ( !isDefined( text ) || !isDefined( player ) )
continue;
if ( text == ".unlock" )
{
setLocked( false, player );
}
else if ( text == ".lock" )
{
setLocked( true, player );
}
}
}
// Set lock state and announce via kill feed.
// actor: optional player who triggered the change.
setLocked( shouldLock, actor )
{
actorName = getActorName( actor );
// Block locking until the minimum round is reached
if ( shouldLock && !isRoundLockActive() )
{
if ( isDefined( actor ) )
actor iPrintLn( "^3Locking is disabled until round ^5" + level.min_lock_round );
return;
}
if ( shouldLock )
{
level.lock_initialized = true;
level.locked = true;
level.pin = generatePin();
setDvar( "g_password", level.pin );
setDvar( "password", level.pin );
announceAll( actorName + " ^7locked the server. Password ^5" + level.pin );
}
else
{
level.locked = false;
setDvar( "g_password", "" );
setDvar( "password", "" );
announceAll( actorName + " ^7unlocked the server." );
}
}
// Helpers
isRoundLockActive()
{
return isDefined( level.round_number ) && level.round_number >= level.min_lock_round;
}
getLockedMessage()
{
return "Server is now ^1LOCKED^7. Use password ^5" + level.pin + " ^7to rejoin. Unlock with ^5ADS + 2^7 or type ^5.unlock^7";
}
getUnlockedMessage()
{
return "Server remains ^2unlocked^7 - to lock again do ^5.lock^7 (or press ^5ADS + 2^7)";
}
// Kill feed broadcast
announceAll( message )
{
players = getPlayersSafe();
for ( i = 0; i < players.size; i++ )
players[i] iPrintLn( message );
}
// Safe actor name
getActorName( actor )
{
if ( isDefined( actor ) && isDefined( actor.name ) )
return actor.name;
return "Someone";
}
// 4-digit PIN
generatePin()
{
str = "";
for ( i = 0; i < 4; i++ )
str = str + randomInt( 10 );
return str;
}
// Safe players array getter
getPlayersSafe()
{
if ( isDefined( level.players ) )
return level.players;
return getEntArray( "player", "classname" );
}
// Clear password on game end
resetPasswordOnEnd()
{
level endon( "disconnect" );
level waittill( "end_game" );
setDvar( "g_password", "" );
setDvar( "password", "" );
}
Quick conversion of my T6 Script, Locks a server on a defined round and then Adds a randomly generated pin after a round so players disconnected can rejoin 
https://github.com/CoreyUK/T4ZM-Scripts/blob/main/Join-in-progress-script/PostRoundLock.gsc