SA-MP Forums Archive
How to make a 1 minute 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)
+--- Thread: How to make a 1 minute countdown (/showthread.php?tid=363349)



How to make a 1 minute countdown - ShawtyyMacJunior - 27.07.2012

I want to make a timer that starts at 1:00 and goes down to 0. I want it also to show and the screen ( bottom right ) as it counts down.


Re: How to make a 1 minute countdown - avivelkayam - 27.07.2012

Код:
forward CountDown(cd);
public CountDown(cd)
{
      new ctd[20];
      format(ctd, sizeof(ctd), "%d", cd);
      GameTextForAll(ctd,1000,3);
      if(cd > 0)
      {
              cd--;
              SetTimerEx("CountDown",false, 1000, "d", cd);
       }
       else GameTextForAll("Go",1000,3);
       return 1;
}
and if you want to do a 1 min countdown you use:
CountDown(60);


hope i help


AW: How to make a 1 minute countdown - Tigerkiller - 28.07.2012

avi why you are formating a string ?