SA-MP Forums Archive
How to make a countdown? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make a countdown? (/showthread.php?tid=130672)



How to make a countdown? - biltong - 27.02.2010

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


Re: How to make a countdown? - [HiC]TheKiller - 27.02.2010

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;
}



Re: How to make a countdown? - biltong - 15.03.2010

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


Re: How to make a countdown? - biltong - 16.03.2010

Bump


Re: How to make a countdown? - Jeffry - 16.03.2010

Check this out.

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

Cheers.


Re: How to make a countdown? - aircombat - 16.03.2010

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


Re: How to make a countdown? - Jeffry - 16.03.2010

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

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