ItsMods

Full Version: Check for current score/ time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
Perhaps it's something along the lines of level waittill "game_ended"? Is there a waittill statement I can use?
So nobody wants to help the newbie huh? Okay.. I get it >.< Or is it that no one knows how to accomplish this?
if ( getTeamScore( string/team ) >= (var get the max score using getDvarInt, so something like score = getDvarInt( "scr_" + level.gametype + "_score_limit" ) )
(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.
Could have easily just done level waittill("game_ended"); lol
(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)
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
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?
alignX/y and horz/vertAlign....
Pages: 1 2