[Release] [ZM] Highest Round Tracker

Topic created · 2 Posts · 126 Views
  • This was coded awhile ago and was requested to be released. So I'm going to release it and show how it can be used on a dedicated server.

    EXAMPLE VIDEO BEATING ROUND 1 RECORD
    Youtube Video

    HOW TO ADD INTO YOUR SERVER
    This can easily be added into your _clientids.gsc file.

    1. Add the scripts below into your _clientids.gsc file
    high_round_tracker()
    {
    	level.HighRound = getDvarIntDefault( mapName( level.script ) + "HighRound", 1 );
    	level.HighRoundPlayers = getDvar( mapName( level.script ) + "Players" );
    	if ( level.HighRoundPlayers == "" )
    	{
    		level.HighRoundPlayers = "UnNamed Players";
    	}
    	for ( ;; )
    	{
    		level waittill ( "end_game" );
    		if ( level.round_number > level.HighRound )
    		{
    			setDvar( mapName( level.script ) + "HighRound", level.round_number );
    			setDvar( mapName( level.script ) + "Players", "" );
    			level.HighRound = getDvarIntDefault(  mapName( level.script ) + "HighRound", 1 );
    			players = get_players();
    			for ( i = 0; i < players.size; i++ )
    			{
    				if ( getDvar( mapName( level.script ) + "Players" ) == "" )
    				{
    					setDvar( mapName( level.script ) + "Players", players[i].name );
    					level.HighRoundPlayers = getDvar( mapName( level.script ) + "Players" );
    				}
    				else
    				{
    					setDvar( mapName( level.script ) + "Players", level.HighRoundPlayers + ", " + players[i].name );
    					level.HighRoundPlayers = getDvar( mapName( level.script ) + "Players" );
    				}
    			}
    			iprintln ( "New Record: ^1" + level.HighRound );
    			iprintln ( "Set by: ^1" + level.HighRoundPlayers );
    			logprint( "Map: " + mapName( level.script ) + " Record: " + level.HighRound + " Set by: " + level.HighRoundPlayers );
    		}
    	}
    }
    
    mapName( name )
    {
    	if( name == "zm_highrise" )
    		return "DieRise";
    	else if( name == "zm_buried" )
    		return "Buried";
    	else if( name == "zm_prison" )
    		return "Motd";
    	else if( name == "zm_tomb" )
    		return "Origins";
    	else if( name == "zm_nuked" )
    		return "Nuketown";
    	else if( name == "zm_transit" && level.scr_zm_map_start_location == "transit" )
    		return "Transit";
    	else if( name == "zm_transit" && level.scr_zm_map_start_location == "town" )
    		return "Town";
    }
    
    high_round_info()
    {
    	wait 5;
    	self iprintln ( "Highest Round for this Map: ^1" + level.HighRound );
    	self iprintln ( "Record set by: ^1" + level.HighRoundPlayers );
    }
    
    1. Add thread high_round_tracker(); into your init() function
    2. Add player thread high_round_info(); into your onPlayerConnect() function
      unknown.png

    Using these steps will allow the server to track everything up until the server is restarted
    Once the server is restarted, the values are reset.
    To get around this, the code logs every time a record is set. Allowing the server owner to keep up with records, even with server resets.

    IF YOU NEED TO RESET YOUR SERVER AND WANT TO KEEP RECORDS
    If you're running multiple servers, you should make different named logs.
    Change the name of logs inside your dedicated_zm.cfg file or other cfg files
    Screenshot_1.png
    Screenshot_6.png
    Logs by default are kept in games_zm.log
    Screenshot_3.png

    1. Open your log and check for any new records (you can ctrl+f and search for "set by")
      Screenshot_4.png

    2. Add the record into your dedicated_zm.cfg file (or whatever file you're using)
      Screenshot_5.png

    Now when the server is restarted, it will keep the "new record" of Round 2, and the player
    Each map can be recorded individually on the server and not run into issues (for those who use map rotation)

    Examples for all maps:

    set BuriedHighRound 1
    set BuriedPlayers "None, N/A"
    set DieRiseHighRound 1
    set DieRisePlayers "None, N/A"
    set MotdHighRound 1
    set MotdPlayers "None, N/A"
    set OriginsHighRound 1
    set OriginsPlayers "None, N/A"
    set NuketownHighRound 1
    set NuketownPlayers "None, N/A"
    set TransitHighRound 1
    set TransitPlayers "None, N/A"
    set TownHighRound 1
    set TownPlayers "None, N/A"
    
  • nice release gamer

Log in to reply