02.09.2013, 02:12
It's easy. Generaly, you should use timer.
At the beginning of gamemode declare two variables and forward our public timer.
then in code that should write first ready, you must display first phrase("Ready?") and start timer.
of course, if you want to display this text only to racers, you should use GameTextForPlayer(...);
and then you should declare your countdown function.
You've done it!
At the beginning of gamemode declare two variables and forward our public timer.
Код:
new iCountdownStep, tCountdownTimer; forward Countdown();
Код:
GameTextForAll("Ready?", 1000, 4); //time=1000, style=4 iCountdownStep = 0; tCountdownTimer = SetTimer("Countdown", 1000, true); //repeat=true
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++ }