TextDraw Timers - 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: TextDraw Timers (
/showthread.php?tid=163870)
TextDraw Timers -
Code_Red - 29.07.2010
Hey
I Want To Create A Timer Using Textdraw that will go from 00:00 to something like 10:00
and it will go like this:
00:00
00:01
00:02
etc
thanks
Re: TextDraw Timers -
iJumbo - 29.07.2010
up
new timers=0;
on a command
SetTimer("texttimer",1000,1);
public texttimer(playerid)
{
new string[128];
switch(timers)
{
case 0:
{
strpack(string, "00.00");
TextDrawSetString(name, string);
timers++;
}
case 1:
{
strpack(string, "00.01");
TextDrawSetString(name, string);
rimers++;
return 1;
}
}
return 0;
}
and at last chase set a killtimer try this not test
Re: TextDraw Timers -
ikey07 - 29.07.2010
Here you go
pawn Код:
forward TextDrawTimer();
new txdtimer;
new time;
txdtimer = SetTimer("TextDrawTimer",1000,1);
public TextDrawTimer()
{
new string[32];
new hour,minute,second;
if(time >= 3600) { hour = time/3600; time = time-(hour*3600); } else { hour = 0; }
if(time >= 60) { minute = time/60; time = time-(minute*60); } else { minute = 0; }
if(time < 60) { second = time; } else { second = 0; }
format(string,sizeof(string),"%02d:%02d:%02d",hour,minute,second);
TextDrawSetString(YourTEXTDRAW,string);
time++;
}
also you need somewhere
pawn Код:
KillTimer(txdtimer);
time = 0;
with this you can count hours minutes seconds