Capture the Flag timer bug
#1

Hey all,

Im making my own Capture the flag GM, but when the timer turns 00:00 it starts counting down again so 00:-10 example.

Also the most points check doesnt work. it just sends the first message.

Code:

This is under onesecondpublic, a Public that does a action each 1sec.
pawn Код:
if(PlayTimeMinutes >= 9)
            {
                PlayTimeSeconds --;
                if(PlayTimeSeconds == 0)
                {
                    PlayTimeMinutes --;
                    PlayTimeSeconds = 60;
                }
                format(string, sizeof(string), "%d:%d", PlayTimeMinutes, PlayTimeSeconds);
                TextDrawSetString(TimeTD,string);
            }
            if(PlayTimeMinutes <= 10)
            {
                PlayTimeSeconds --;
                if(PlayTimeSeconds == 0)
                {
                    PlayTimeMinutes --;
                    PlayTimeSeconds = 60;
                }
                format(string, sizeof(string), "0%d:%d", PlayTimeMinutes, PlayTimeSeconds);
                TextDrawSetString(TimeTD,string);
            }
            if(PlayTimeMinutes == 0)
            {
                if(PlayTimeSeconds >= 0)
                {
                    PlayTimeSeconds --;
                    format(string, sizeof(string), "00:%d", PlayTimeSeconds);
                    TextDrawSetString(TimeTD,string);
                }
                if(PlayTimeSeconds == 0)
                {
                    format(string, sizeof(string), "00:00");
                    TextDrawSetString(TimeTD,string);
                    TogglePlayerControllable(i, 0);
                    SetTimerEx("StartNewRound", 15000, false, "d", i);
                    if(BlueScore >= RedScore)
                    {
                        format(string, sizeof(string), "Congratulations to {0000FF}Team Blue, {FFFF00}they have won with %d point!", BlueScore);
                        SendClientMessageToAll(YELLOW, string);
                    }
                    else if(RedScore >= BlueScore)
                    {
                        format(string, sizeof(string), "Congratulations to {FF0000}Team Red, {FFFF00}they have won with %d point!", RedScore);
                        SendClientMessageToAll(YELLOW, string);
                    }
                    else if(RedScore == BlueScore)
                    {
                        format(string, sizeof(string), "Nobody won this match, {0000FF}%d {FFFF00}vs {FF0000}%d", BlueScore, RedScore);
                        SendClientMessageToAll(YELLOW, string);
                    }
                }
            }
Reply


Messages In This Thread
Capture the Flag timer bug - by Stefand - 31.08.2012, 13:05
Re: Capture the Flag timer bug - by Misiur - 31.08.2012, 13:27
Re: Capture the Flag timer bug - by Stefand - 31.08.2012, 13:53
Re: Capture the Flag timer bug - by Stefand - 31.08.2012, 14:08
Re: Capture the Flag timer bug - by Misiur - 31.08.2012, 14:11

Forum Jump:


Users browsing this thread: 1 Guest(s)