Textdraw Counter
#2

pawn Код:
// top of your script
new C, CountTimer;

// Textdraw
RobberyCountDown = TextDrawCreate(562.000000, 293.000000, "20");
TextDrawBackgroundColor(RobberyCountDown, 255);
TextDrawFont(RobberyCountDown, 1);
TextDrawLetterSize(RobberyCountDown, 0.500000, 1.000000);
TextDrawColor(RobberyCountDown, -16776961);
TextDrawSetOutline(RobberyCountDown, 0);
TextDrawSetProportional(RobberyCountDown, 0);
TextDrawSetShadow(RobberyCountDown, 1);
// after you made the textdraw
CountTimer = SetTimer("Count", 1000, true); // set a timer that will call the forwarded public Count every 1 second
C = 20; // Set the count to 20
pawn Код:
forward Count();
public Count()
{
    C --;
    new str[8];
    format(str, sizeof(str), "%d", C);
    TextDrawSetString(RobberyCountDown, str);
    if(C == 0) // when the count down ends
    {
        KillTimer(CountTimer);
        TextDrawDestroy(RobberyCountDown);
        // other stuff
    }
    return 1;
}
Reply


Messages In This Thread
Textdraw Counter - by Michael_Cruise - 12.06.2012, 09:29
Re: Textdraw Counter - by [KHK]Khalid - 12.06.2012, 10:00

Forum Jump:


Users browsing this thread: 1 Guest(s)