Posts: 277
Threads: 65
Joined: Aug 2011
Reputation:
0
Ok i know how to create a timer but what i wanted to know is how i could have the time showing on the players screen like counting down from 60 seconds i dont want it in the normal message box but in the place where normal a message appears if a admin does /ann.
Many thanks.
(will rep ofc))
Posts: 277
Threads: 65
Joined: Aug 2011
Reputation:
0
Ok but how do i make it work with the timer that is what im not 100% about. (im 0% sure how lol)
Posts: 6,129
Threads: 36
Joined: Jan 2009
This should be sufficient:
pawn Код:
// In OnGameModeInit or wherever the timer is supposed to start...
new
iTimedCountdown = -1,
rCountdownHandle;
rCountdownHandle = SetTimer("TimedCountdown", 1000, true);
// Somewhere outside of a function
forward TimedCountdown();
public TimedCountdown() {
if(iTimedCountdown == -1) {
iTimedCountdown = 61;
}
new
szMessage[10];
iTimedCountdown--;
format(szMessage, sizeof(szMessage), "~r~%d..."); // Add more in if you wish.
GameTextForAll(szMessage, 950, 3);
if(iTimedCountdown == 0) {
KillTimer(rCountdownHandle);
}
return 1;
}