Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Check for current score/ time
#1
How can I check the current score or time left in a match?

I would like to hook a map voting system that activates only when it is near the end of the match. I would also like to switch to the map only after the match has completed and players are on the scoreboard.

Is there something I can do through "self notify" or game["state"]?

Halp
Reply

#2
Perhaps it's something along the lines of level waittill "game_ended"? Is there a waittill statement I can use?
Reply

#3
So nobody wants to help the newbie huh? Okay.. I get it >.< Or is it that no one knows how to accomplish this?
Reply

#4
if ( getTeamScore( string/team ) >= (var get the max score using getDvarInt, so something like score = getDvarInt( "scr_" + level.gametype + "_score_limit" ) )
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#5
(05-26-2014, 23:46)DidUknowiPwn Wrote: if ( getTeamScore( string/team ) >= (var get the max score using getDvarInt, so something like score = getDvarInt( "scr_" + level.gametype + "_score_limit" ) )

Excellent.. Many thanks to you. Problem solved.
Reply

#6
Could have easily just done level waittill("game_ended"); lol
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#7
(05-27-2014, 01:34)DidUknowiPwn Wrote: Could have easily just done level waittill("game_ended"); lol

Okay, so apon further analysis it looks like this might not solve the problem. Tongue I figured, hey... Diduknowipwn answered... Evidently the expert around these parts. I figured it was the answer I was looking for.

I want to call something 2 minutes before the game timer runs out, or when 3 quarters of the score has gone by. Preferably noob friendly, so I can understand it and learn from it. (lol)
Reply

#8
Code:
close_game()
{
    level endon( "game_ended" );
    time_limit = getDvarInt( "scr_" + level.gametype + "timelimit" );
    when_to_call = getDvarInt( "scr_game_call_end" );

        //edit
        time_limit *= 60;
        when_to_call *= 60;
        //
    end_when = time_limit - when_to_call;
    
    while( true )
    {
        time = ( getTime() * 1000 );
        if( time == end_when )
        {
            //do shit
        }
        wait 0.1;
    }
}
Don't recall if gametype var was timelimit or time_limit.

Now that I look at this, this is absolutely wrong code. This was at 10PM so I wasn't thinking l0l
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#9
Lol ! Oh well! I have another question for you anyway =)

How could I account for different client resolutions/ aspect ratio's when creating hud elements like text and shaders? I know I can define a static- like position by using "setpoint" or "align x/ align y" to place it top right/ bottom left etc. but obviously when defining specific X and Y coords, the elements will be in different positions depending on the resolution of the window. Is it possible?
Reply

#10
alignX/y and horz/vertAlign....
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Change Player Score Xaedrus 8 5,501 04-07-2015, 18:06
Last Post: Nekochan
  Help with Nuke freezing score fathom 2 2,317 05-09-2014, 03:39
Last Post: fathom

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.