Countdown - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Countdown (
/showthread.php?tid=83775)
Countdown -
sggassasin - 27.06.2009
Hi i was woundering how to make a countdown timer so it gose
5
4
3
2
1
but it shows 1 number at a time so if someone could help that wold be nice
Re: Countdown -
Grim_ - 27.06.2009
somethign like this
pawn Код:
//top of script
new count = 5;
new counttimer;
forward CountDown();
//after main()
public CountDown()
{
if(count <= 0)
{
GameTextForAll("~g~ Go ~n~ Go ~n~ Go!", 5000, 5);
KillTimer(counttimer);
count = 5;
return 1;
}
else
{
new str[128];
format(str, sizeof str, "~b~ %d", count);
GameTextForAll(str, 500, 5);
counttimer = SetTimer("CountDown", 1000, 0);
}
return 1;
}
//command
if(strcmp(cmdtext, "/countdown", true) == 0)
{
CountDown();
}
Re: Countdown -
sggassasin - 27.06.2009
it just repeats 5 5 5 5 5 5 5 5 5 5 5
Re: Countdown -
Grim_ - 27.06.2009
my bad After this line
pawn Код:
counttimer = SetTimer("CountDown", 1000, 0);
put:
Re: Countdown -
sggassasin - 27.06.2009
it worked thx
Re: Countdown -
Grim_ - 27.06.2009
Eh, no problem