SA-MP Forums Archive
Countdown in TextLabel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Countdown in TextLabel (/showthread.php?tid=375849)



Countdown in TextLabel - jeremy8810 - 08.09.2012

Hi guys,

I have some timers to move objects, but how can I make a countdown in a textlabel that repeats?
Can someone explain me how to, or maybe make an example?

I appreciate, thanks


Re: Countdown in TextLabel - jeremy8810 - 20.09.2012

Bump, anyone?


Re: Countdown in TextLabel - clarencecuzz - 20.09.2012

pawn Код:
new Countdown; //At the top of your script

public OnGameModeInit() //Or OnFilterScriptInit()
{
    Countdown = 120; //You can replace 120 with whatever time (in seconds) you want, you can use this under commands as well.
    SetTimer("Counting", 1000, true);
    return 1;
}

forward Counting();
public Counting()
{
    if(Countdown > 0)
    {
        Countdown--;
    }
    return 1;
}
If you're talking about Textdraws:
pawn Код:
TextDrawSetString(TextDraw, string); //Replace TextDraw with your text draw id
https://sampwiki.blast.hk/wiki/TextDrawSetString

If you're talking about 3D Text Labels:
pawn Код:
Update3DTextLabelText(label, color, string); //replace label and color with your desired variables.
https://sampwiki.blast.hk/wiki/Update3DTextLabelText

If you're talking about GameText:
pawn Код:
GameTextForAll(string, 1000, 5); //Or GameTextForPlayer alternatively
https://sampwiki.blast.hk/wiki/GameTextForPlayer
https://sampwiki.blast.hk/wiki/GameTextForAll

You weren't very clear in your first post about what you ACTUALLY wanted it for, so I cannot complete it for you.


Re: Countdown in TextLabel - jeremy8810 - 20.09.2012

Thanks for your reply this really helped me a lot! +1 respect