Textdraw counting from 15:00 to 0:00
#2

Untested
pawn Код:
//At top
new CD;
new CDTimer;

//OnGameModeInit
new Text:CDTextDraw;
CDTextDraw = TextDrawCreate(240.0, 580.0, "_");

//In your command (To start the count down)
CD = 15;
TextDrawShowForAll(CDTextDraw);
CDTimer = SetTimer("CountDown", 1000, true);

//Somewhere in ur script but now in any callbacks
forward CountDown();
public CountDown()
{
    if(CD != 0)
    {
        new string[6];
        format(string, sizeof(string), "%02d", CD);
        TextDrawSetString(CDTextDraw, string);
        CD --;
    }
    else
    {
        KillTimer(CDTimer);
        TextDrawSetString(CDTextDraw, "CD stopped");
    }
    return 1;
}
Reply


Messages In This Thread
Textdraw counting from 15:00 to 0:00 - by freshOrange - 04.07.2011, 07:58
Re: Textdraw counting from 15:00 to 0:00 - by Laronic - 04.07.2011, 08:10
Re: Textdraw counting from 15:00 to 0:00 - by freshOrange - 04.07.2011, 08:47
Re: Textdraw counting from 15:00 to 0:00 - by Laronic - 04.07.2011, 08:48
Re: Textdraw counting from 15:00 to 0:00 - by Lorenc_ - 04.07.2011, 08:49
Re: Textdraw counting from 15:00 to 0:00 - by freshOrange - 04.07.2011, 08:54
Re: Textdraw counting from 15:00 to 0:00 - by Joe Staff - 04.07.2011, 08:58
Re: Textdraw counting from 15:00 to 0:00 - by freshOrange - 04.07.2011, 08:59
Re: Textdraw counting from 15:00 to 0:00 - by Jeffry - 04.07.2011, 10:41
Re: Textdraw counting from 15:00 to 0:00 - by freshOrange - 04.07.2011, 10:43

Forum Jump:


Users browsing this thread: 1 Guest(s)