TextDraw Timers
#1

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
Reply
#2

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
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)