How to script this count?
#1

How can i script this type of countdown?

This is the Command with ZCMD
/count [hour] [min] [sec]
I want this command and i want that it should show a textdraw with Timer like
HH/MM/SS

ok?

Please tell me how to make it?
Reply
#2

You use a timer which calls a the countdown functions (each second)
And each time it gets decrease the time variable and update the textdraw
If the time hits zero show some text and kill the timer
Reply
#3

Sorry but its difficult for me if i get the code then it will be easy for me to learn and make some more nice ones.
Reply
#4

Is there anyone who can help this poor person?


*BUMP*
Reply
#5

ill give you a small code to start.

new Counter;

in your cmd:

Counter = SetTimer("count",true);

and i can give you the full code later
Reply
#6

LoL
Is this some kind of a joke?
Reply
#7

pawn Код:
// Your cmd
    TextDrawShowForPlayer(playerid, YourTextdraw);
    CountDown(YourTextdraw, playerid, 5);
pawn Код:
forward CountDown(Text: text, playerid, time);
public CountDown(Text: text, playerid, time) {
    if(time < 1) {
        TextDrawSetString(text, "~r~GoGo!");
        SetTimerEx("tTextDrawHide", 5000, false, "ii", playerid, _: text);
    } else {
        new
            str[8] = "~r~";
        valstr(str[3], time, false);
        TextDrawSetString(text, str);
        SetTimerEx("CountDown", 1000, false, "iii", _: text, playerid, --time);
    }
}
pawn Код:
forward tTextDrawHide(playerid, Text: text);
public tTextDrawHide(playerid, Text: text) {
    if(playerid == MAX_PLAYERS) {
        TextDrawHideForAll(text);
    } else {
        TextDrawHideForPlayer(playerid, text);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)