How to make a countdown?
#1

I tried to make a textdraw that would count down from 60 seconds, but it failed hard, never actually counting down and it kept flashing all the time. Could someone point me to a tutorial or something that would show me how to do this? I've ******d but have found nothing
Reply
#2

Replace textdraw0 with your textdraw.
pawn Код:
new Timer, TimeS;

stock Countdown()
{
  TextdrawShowForAll(textdraw0);
  TextDrawSetString(textdraw0, "60");
  Timer = SetTimer("Counting", 1000, true);
  TimeS = 60;
}

forward Counting();
public Counting()
{
  TimeS --;
  if(TimeS == 0)
  {
    KillTimer(Timer);
    TextDrawHideForAll(textdraw0);
  }
  new TimeF[3];
  format(TimeF, 3, "%d", TimeS);
  TextDrawSetString(textdraw0, TimeF);
  return 1;
}
Reply
#3

Bump. How would I adapt that script so it counts down from 10 minutes?
Reply
#4

Bump
Reply
#5

Check this out.

http://forum.sa-mp.com/index.php?topic=149833.0

Cheers.
Reply
#6

change the
Код:
1000
with the time u want in milliseconds
Reply
#7

Okay, this is how im using too,
I sorted it a bit for you:

http://forum.sa-mp.com/index.php?top...9227#msg949227
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)