How to make a lil clock (textdraw) - 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 lil clock (textdraw) (
/showthread.php?tid=122999)
How to make a lil clock (textdraw) -
`FuTuRe- - 24.01.2010
It starts on 8 minutes left and it counts down to 0 how do i make this?
Re: How to make a lil clock (textdraw) -
Roleplaya - 24.01.2010
First make a textdraw and then timer i think
Re: How to make a lil clock (textdraw) -
`FuTuRe- - 24.01.2010
I know, but how make it go in seconds down? like 8:00 1 sec later 7:59 etc.
Re: How to make a lil clock (textdraw) -
mansonh - 24.01.2010
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
}
Re: How to make a lil clock (textdraw) -
MadeMan - 24.01.2010
pawn Код:
new timeleft = 480; // 8 minutes in seconds
pawn Код:
minutes = timeleft / 60;
seconds = timeleft % 60;