24.11.2009, 17:05
How can i make a countdown timer that starts from 8 mins and countsdown? I want it in the top-right cornor of my screen. How can i do it?
Originally Posted by [WsR
RyDeR ]
Define your time, after this make a use a timer of 990 ms. And put in the public: nameofyouredefine--; |
new CountDownFromAmount; forward CountDownTimer();
CountDownFromAmount = 480; // 8min. SetTimer("CountDownTimer", 999, 1);
public CountDownTimer() { CountDownFromAmount--; if (CountDownFromAmount == 0) { GameTextForAll("End of round!!", 3000, 5); } return 1; }
Originally Posted by [WsR
RyDeR ]
Top of the script; Code:
new CountDownFromAmount; forward CountDownTimer(); Code:
CountDownFromAmount = 480; // 8min. SetTimer("CountDownTimer", 999, 1); Code:
public CountDownTimer() { CountDownFromAmount--; if (CountDownFromAmount == 0) { GameTextForAll("End of round!!", 3000, 5); } return 1; } |
new string[128]; format(string, 128, "%d", CountDownFromAmount); GameTextForAll(string, 990, 5);
Originally Posted by [WsR
RyDeR ]
Code:
new string[128]; format(string, 128, "%d", CountDownFromAmount); GameTextForAll(string, 990, 5); |
new string[128]; format(string, 128, "%d", CountDownFromAmount); TextDrawSetString(Text:Textdrawname, string); TextDrawShowForAll(Text:Textdrawname);
Originally Posted by [WsR
RyDeR ]
If you have a Textdraw you can do it like this: Code:
new string[128]; format(string, 128, "%d", CountDownFromAmount); TextDrawSetString(Text:Textdrawname, string); TextDrawShowForAll(Text:Textdrawname); |
public CountDownTimer() { CountDownFromAmount--; new string[128]; format(string, 128, "%d", CountDownFromAmount); TextDrawSetString(Text:Textdrawname, string); TextDrawShowForAll(Text:Textdrawname); if (CountDownFromAmount == 0) { GameTextForAll("End of round!!", 3000, 5); } return 1; }
Originally Posted by [WsR
RyDeR ]
In the timer. Код:
public CountDownTimer() { CountDownFromAmount--; new string[128]; format(string, 128, "%d", CountDownFromAmount); TextDrawSetString(Text:Textdrawname, string); TextDrawShowForAll(Text:Textdrawname); if (CountDownFromAmount == 0) { GameTextForAll("End of round!!", 3000, 5); } return 1; } |
CountDownFromAmount = 480; // 8min.
SetTimer("CountDownTimer", 999, 1);
return 1;
}
public CountDownTimer()
{
new string[128];
format(string, 128, "%d", CountDownFromAmount);
TextDrawSetString(Text:Timer, string);
TextDrawShowForAll(Text:Timer);
CountDownFromAmount--;
return 1;
}
expected token ; but found public