Results 1 to 5 of 5

Thread: Problem with scorelimit in zpam

  1. #1
    Private
    Join Date
    Feb 2014
    Posts
    27
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question Problem with scorelimit in zpam

    Hi!

    I'm using a new version of pam mod (zpam v2.06) "zPAM edition made ​​by z0d" - I think he is a user of this forum, I tried to contact him and could not...

    link: http://eu.cybergamer.com/files/6597/

    but it has a problem, it is not possible to determine a maximum score for the end of deathmatch and team deathmatch.

    Code:
    scr_dm_scorelimit 
    ui_dm_scorelimit
    scr_tdm_scorelimit
    ui_dm_scorelimit
    > The map does not end when the specified value is reached.

    i have no idea how to fix it, if z0d appear here, or anyone knows how to fix I'd be grateful.

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    From the enclosed server.cfg file:

    Code:
    /*This will allow you to trigger the end of a map/match by a team's TOTAL score, including the 1st half and 2nd half (is halftime is being used). 0 = disabled*/
    seta scr_tdm_end_score "20"
    So, the reason it wont work is because you are setting the wrong dvar. Try setting the right one and it will work.

  3. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (3rd June 2014)

  4. #3
    Private
    Join Date
    Feb 2014
    Posts
    27
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by Tally View Post
    From the enclosed server.cfg file:

    Code:
    /*This will allow you to trigger the end of a map/match by a team's TOTAL score, including the 1st half and 2nd half (is halftime is being used). 0 = disabled*/
    seta scr_tdm_end_score "20"
    So, the reason it wont work is because you are setting the wrong dvar. Try setting the right one and it will work.

    Sorry, my mistake in TDM mode. I will edit first post. The problem is only in DM mode.

    I put this command to test:

    Code:
    seta scr_dm_scorelimit "1"
    screenshot:
    Click image for larger version. 

Name:	shot0000.jpg 
Views:	44 
Size:	100.2 KB 
ID:	713
    the game should have ended. note in the upper left corner "2/1".

  5. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    I looked through the DM gametype file in the PAM mod you linked to and found that the scorelimit code has been commented out (made blank). Which means you can easily edit it back to being active.

    Look in zPAM206.iwd/maps/pam for this:

    Code:
    updateGametypeCvars()
    {
    	// ePAM
    	level endon("timeoutcalled");
    	timelimit = getCvarFloat("scr_dm_timelimit");
    	if (level.timelimit < timelimit)
    	{
    		timelimit = level.timelimit;
    	}
    	//
    	for(;;)
    	{
    		if(level.timelimit != timelimit)
    		{
    			if(timelimit > 1440)
    			{
    				timelimit = 1440;
    				setCvar("scr_dm_timelimit", "1440");
    			}
    
    			level.timelimit = timelimit;
    			setCvar("ui_dm_timelimit", level.timelimit);
    			level.starttime = getTime();
    
    			if(level.timelimit > 0)
    			{
    				if(!isDefined(level.clock))
    				{
    					level.clock = newHudElem();
    					level.clock.horzAlign = "left";
    					level.clock.vertAlign = "top";
    					level.clock.x = 8;
    					level.clock.y = 2;
    					level.clock.font = "default";
    					level.clock.fontscale = 2;
    				}
    				level.clock setTimer(level.timelimit * 60);
    			}
    			else
    			{
    				if(isDefined(level.clock))
    					level.clock destroy();
    			}
    
    			checkTimeLimit();
    		}
    
    		/*
    		scorelimit = getCvarInt("scr_dm_scorelimit");
    		if(level.scorelimit != scorelimit)
    		{
    			level.scorelimit = scorelimit;
    			setCvar("ui_dm_scorelimit", level.scorelimit);
    			level notify("update_allhud_score");
    		}
    		checkScoreLimit();
    		*/
    
    		wait level.fps_multiplier * 1;
    	}
    }
    And edit it to this:

    Code:
    updateGametypeCvars()
    {
    	// ePAM
    	level endon("timeoutcalled");
    	timelimit = getCvarFloat("scr_dm_timelimit");
    	if (level.timelimit < timelimit)
    	{
    		timelimit = level.timelimit;
    	}
    	//
    	for(;;)
    	{
    		if(level.timelimit != timelimit)
    		{
    			if(timelimit > 1440)
    			{
    				timelimit = 1440;
    				setCvar("scr_dm_timelimit", "1440");
    			}
    
    			level.timelimit = timelimit;
    			setCvar("ui_dm_timelimit", level.timelimit);
    			level.starttime = getTime();
    
    			if(level.timelimit > 0)
    			{
    				if(!isDefined(level.clock))
    				{
    					level.clock = newHudElem();
    					level.clock.horzAlign = "left";
    					level.clock.vertAlign = "top";
    					level.clock.x = 8;
    					level.clock.y = 2;
    					level.clock.font = "default";
    					level.clock.fontscale = 2;
    				}
    				level.clock setTimer(level.timelimit * 60);
    			}
    			else
    			{
    				if(isDefined(level.clock))
    					level.clock destroy();
    			}
    
    			checkTimeLimit();
    		}
    
    		scorelimit = getCvarInt("scr_dm_scorelimit");
    		if(level.scorelimit != scorelimit)
    		{
    			level.scorelimit = scorelimit;
    			setCvar("ui_dm_scorelimit", level.scorelimit);
    			level notify("update_allhud_score");
    		}
    		checkScoreLimit();
    
    		wait level.fps_multiplier * 1;
    	}
    }
    Close and save.

  6. The Following 3 Users Say Thank You to Tally For This Useful Post:

    kung foo man (5th June 2014),Mitch (5th June 2014),qwrtyp (5th June 2014)

  7. #5
    Private
    Join Date
    Feb 2014
    Posts
    27
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Talking

    I made the change but it did not work.
    I think this suggested change removed the need to restart the map to take effect in command scoreboard.

    I was taking a look in the file you mentioned:
    in maps/pam/dm.gsc

    i found this:

    checkScoreLimit()

    .
    .
    Code:
    /* Match Score Check */
    
    /* Match Score Check */
    	if (level.matchscore1 > 0)
    	{
    		if(game["Team_1_Score"] < level.matchscore1 && game["Team_2_Score"] < level.matchscore1)
    			return;
    
    		iprintln(&"MP_SCORE_LIMIT_REACHED");
    
    		if(game["Team_1_Score"] == game["Team_2_Score"] && game["mode"] == "match" && getcvarint("g_ot") == 1)  // have a tie and overtime mode is on
    				maps\pam\end_of_map::Prepare_map_Tie();
    			else
    				setCvar("g_ot_active", "0");
    
    		maps\pam\end_of_map::End_Match_Scoreboard();
    
    		if(level.mapended)
    			return;
    		level.mapended = true;
    
    		thread endMap();
    	}
    then replace this old version:


    Code:
    	if(level.scorelimit <= 0)
    		return;
    
    	if(self.score < level.scorelimit)
    		return;
    
    	if(level.mapended)
    		return;
    	level.mapended = true;
    
    	if(!level.splitscreen)
    		iprintln(&"MP_SCORE_LIMIT_REACHED");
    
    	level thread endMap();
    Thanks a lot Tally, problem fixed!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •