ScoreTimer
#2

Do you want something like:

pawn Код:
new szTimeTicks = 0,
    n_bTimerID; // at top
   
n_bTimerID = SetTimer( "ScoreTimer", 1000, true ); // in gamemode init

forward ScoreTimer( ); // at top

public ScoreTimer( ) // anywhere you want
{
    szTimeTicks++; // counting ticks every second
   
    switch( szTimeTicks ) // switching it
    {
        case 3600: // checking if the time ticks are 1 hour
        {
            szTimeTicks = 0; // resetting the time ticks to 0
            for( new f = 0; f < MAX_PLAYERS; f++ ) // looping the players
            {
                if( IsPlayerConnected( f ) )
                {
                    SetPlayerScore( f, GetPlayerScore( f ) + 1 ); // give the score!
                }
            }
        }
    }
}
Reply


Messages In This Thread
ScoreTimer - by kbalor - 11.08.2012, 20:07
Re: ScoreTimer - by FalconX - 11.08.2012, 20:17
Re: ScoreTimer - by kbalor - 11.08.2012, 20:31
Re: ScoreTimer - by FalconX - 11.08.2012, 20:38
Re: ScoreTimer - by kbalor - 11.08.2012, 21:09
Re: ScoreTimer - by FalconX - 11.08.2012, 21:10

Forum Jump:


Users browsing this thread: 2 Guest(s)