timer with textdraw LOOK!
#4

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
pawn Код:
forward CountDown(seconds);
public CountDown(seconds)
{
  if(seconds == 0)
  {
    //All your code for when the timer reaches 0
    return; //THIS IS ESSENTIAL TO WORK!!!
  }
  SetTimerEx("CountDown", 1000, 0, "d", seconds);
  new minutes;
  while(seconds < 59)
  {
    seconds -= 60;
    minutes++;
  }
  new string[8];
  if(seconds < 10) format(string, sizeof string, "%d:0%d" minutes, seconds);
  else format(string, sizeof string, "%d:%d" minutes, seconds);
  TextDrawSetString(<YOUR TEXTDRAW ID>, string);
}
To start a countdown:
pawn Код:
CountDown(<seconds>);
You could also do "seconds*minutes", if you want for example 8 minutes you can type:

pawn Код:
CountDown(8*60); //8 times 60 is 8 minutes
thank you Hiddos!
Reply


Messages In This Thread
timer with textdraw LOOK! - by thomas.. - 06.09.2010, 20:36
Re: timer with textdraw LOOK! - by Relixious - 06.09.2010, 20:39
Re: timer with textdraw LOOK! - by Hiddos - 06.09.2010, 20:48
Re: timer with textdraw LOOK! - by thomas.. - 06.09.2010, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)