04.02.2010, 17:49
Ok, I've posted this before but no one helped and it seemed to slip onto page 2 in about 20 minutes and no one else responded even after bumping
I have a countdown timer but it's buggered up, it's really annoying because this is vital for 2 of my deathmatch modes
What happens is when I see the textdraw instead of counting 2:59 - 2:58 - 2:57 etc it goes 2:59 - 2:49 - 2:39 I can't understand it
Please help me I need this problem finally fixed
Here is the callback for the countdown
public SetCountDown(minutes, seconds, Float, Float:y)
{
Timer = TextDrawCreate(x, y, "00:00");
TextDrawTextSize(Timer,636.000000,824.000000);
TextDrawAlignment(Timer, 2);
TextDrawFont(Timer,3);
TextDrawLetterSize(Timer,0.499999,1.800000);
TextDrawColor(Timer,0xffffffff);
TextDrawSetProportional(Timer,2);
TextDrawSetShadow(Timer,1);
TextDrawSetOutline(Timer, 1);
Tmin = minutes;
Tsec = seconds;
TTimer = SetTimer("TimerSet",1000,1);
return 1;
}
Here is the "TimerSet" callback that is repeated 1000 ms
public TimerSet()
{
new string[5];
if(Tmin >= 1)
{
Tsec--;
}
if(Tsec <= 0 && Tmin != 0)
{
Tsec = 59;
Tmin--;
}
else if(Tmin == 0 && Tsec == 0)
{
OnCountDownEnd();
}
format(string, 5, "%d:%d",Tmin, Tsec);
TextDrawSetString(Timer, string);
return 1;
}
I would be so grateful if this is fixed
Thanks
I have a countdown timer but it's buggered up, it's really annoying because this is vital for 2 of my deathmatch modes
What happens is when I see the textdraw instead of counting 2:59 - 2:58 - 2:57 etc it goes 2:59 - 2:49 - 2:39 I can't understand it
Please help me I need this problem finally fixed
Here is the callback for the countdown
public SetCountDown(minutes, seconds, Float, Float:y)
{
Timer = TextDrawCreate(x, y, "00:00");
TextDrawTextSize(Timer,636.000000,824.000000);
TextDrawAlignment(Timer, 2);
TextDrawFont(Timer,3);
TextDrawLetterSize(Timer,0.499999,1.800000);
TextDrawColor(Timer,0xffffffff);
TextDrawSetProportional(Timer,2);
TextDrawSetShadow(Timer,1);
TextDrawSetOutline(Timer, 1);
Tmin = minutes;
Tsec = seconds;
TTimer = SetTimer("TimerSet",1000,1);
return 1;
}
Here is the "TimerSet" callback that is repeated 1000 ms
public TimerSet()
{
new string[5];
if(Tmin >= 1)
{
Tsec--;
}
if(Tsec <= 0 && Tmin != 0)
{
Tsec = 59;
Tmin--;
}
else if(Tmin == 0 && Tsec == 0)
{
OnCountDownEnd();
}
format(string, 5, "%d:%d",Tmin, Tsec);
TextDrawSetString(Timer, string);
return 1;
}
I would be so grateful if this is fixed
Thanks