How to make a lil clock (textdraw)
#1

It starts on 8 minutes left and it counts down to 0 how do i make this?
Reply
#2

First make a textdraw and then timer i think
Reply
#3

I know, but how make it go in seconds down? like 8:00 1 sec later 7:59 etc.
Reply
#4

pawn Код:
new Tmin = 0; Thour = 00;

...
new cdTimer = SetTimer("countdown", 1000, 1);
...

public countdowntimer()
{
  Tmin--;
  if(Tmin < 0) Thour--, Tmin=59;
  if(Thour < 0)
  {
    KillTimer(cdTimer);
    ...do whatever you do when timer runs out
    return 1;
  }
  //set your textdraw to the new time and reshow for players
}
Reply
#5

pawn Код:
new timeleft = 480; // 8 minutes in seconds
pawn Код:
minutes = timeleft / 60;
seconds = timeleft % 60;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)