// oben
new countdown_timer;
new countdown_time;
// von wo aus der gestartet werden soll
countdown_time = 300; // 300 sekunden
if(countdown_time == -1) { // wenns den Timer noch nicht gibt, starten, sonst einfach nur zeit ändern
countdown_timer = SetTimer("countdown",1000,1);
}
// irgendwo
public countdown() {
if(countdown_time > 0) {
countdown_time--;
new message[128];
new minutes = ((countdown_time - (countdown_time % 60)) / 60);
new seconds = countdown_time - minutes*60;
format(message,128,"~r~%d~w~:~b~%02d",minutes,seconds);
for(new i = 0; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
GameTextForPlayer(i,message,1002,4);
}
}
} else if(countdown_time == 0) {
KillTimer(countdown_timer);
countdown_time = -1;
}
}