19.07.2015, 19:44
(
Последний раз редактировалось simo0000; 19.07.2015 в 21:03.
)
-Solved-
new SecondCount = 0;
new MaxSeconds = 600;
new CountTimer;
forward Counter();
public Counter()
{
SecondCount++;
new string[256];
new timeremaining = MaxSeconds - SecondCount;
//if(timeremaining == 0) {
//Either add code here for when the timer runs out
//}
for(new i=0;i<MAX_PLAYERS;i++) {
if(timeremaining == 0) {
format(string, sizeof(string), "The timer has run out");
SendClientMessage(i, 0xFF0000FF, string);
//KillTimer(CountTimer);//Example
//SecondCount = 0;//Example
// or here for when the timer runs out for every specific player
} else {
format(string, sizeof(string), "%d remaining!",timeremaining);
SendClientMessage(i, 0xFF0000FF, string);
}
}
return 1;
}
CountTimer = SetTimerEx("Counter", 1*1000, true, "d");// add where you want to start the timer.
KillTimer(CountTimer);// add where you wanna kill the timer
SecondCount = 0;// add where you wanna reset seconds of counter
new seconds = SecondCount, minutes;
while(seconds > 59)
{
seconds -= 60;
minutes++;
}
format(string, sizeof(string), "%02d:%02d remaining!",minutes,seconds);
PHP код:
|
Just made this real quick incase you do need it, just replace second format with this: PHP код:
|