PDA

View Full Version : How to script this count?


Spooky
30/12/2011, 11:56 AM
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?

Nero_3D
30/12/2011, 12:32 PM
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

Spooky
30/12/2011, 12:32 PM
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.

Spooky
30/12/2011, 01:28 PM
Is there anyone who can help this poor person?


*BUMP*

Tigerkiller
30/12/2011, 02:16 PM
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

Spooky
30/12/2011, 02:24 PM
LoL
Is this some kind of a joke?

Nero_3D
30/12/2011, 04:01 PM
// Your cmd
TextDrawShowForPlayer(playerid, YourTextdraw);
CountDown(YourTextdraw, playerid, 5);

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);
}
}
forward tTextDrawHide(playerid, Text: text);
public tTextDrawHide(playerid, Text: text) {
if(playerid == MAX_PLAYERS) {
TextDrawHideForAll(text);
} else {
TextDrawHideForPlayer(playerid, text);
}
}