Countdown help
#2

It's easy. Generaly, you should use timer.

At the beginning of gamemode declare two variables and forward our public timer.
Код:
new iCountdownStep, tCountdownTimer;
forward Countdown();
then in code that should write first ready, you must display first phrase("Ready?") and start timer.
Код:
GameTextForAll("Ready?", 1000, 4); //time=1000, style=4
iCountdownStep = 0;
tCountdownTimer = SetTimer("Countdown", 1000, true); //repeat=true
of course, if you want to display this text only to racers, you should use GameTextForPlayer(...);

and then you should declare your countdown function.
Код:
public Countdown()
{
	switch(iCountdownStep)
	{
		case 0:
		{
			GameTextForAll("3", 1000, 4);
		}
		case 1:
		{
			GameTextForAll("2", 1000, 4);
		}
		case 2:
		{
			GameTextForAll("1", 1000, 4);
		}
		default:
		{
			GameTextForAll("~g~GO!", 3000, 4);
			KillTimer(tCountdownTimer);
		}
	}
	iCountdownStep++
}
You've done it!
Reply


Messages In This Thread
Countdown help - by Finn707 - 01.09.2013, 20:12
Re: Countdown help - by Borg - 02.09.2013, 02:12
Re: Countdown help - by Finn707 - 02.09.2013, 11:15
Re: Countdown help - by Borg - 02.09.2013, 17:24
Re: Countdown help - by Finn707 - 02.09.2013, 18:07

Forum Jump:


Users browsing this thread: 1 Guest(s)