Textdraw problem
#1

Okay, so I've got a little problem on textdraws.
Well, see, I've created a timer textdraw but this
happens everytime...

Код:
Minutes : 7 Seconds : 01
Minutes : 7 Seconds : 00
Minutes : 7 Seconds : 59
Minutes : 7 Seconds : 58
Minutes : 6 Seconds : 57
You get my point

Heres the code :
pawn Код:
new Text:TimeTD;
new Seconds = 59;
new Minutes = 9;

public OnGameModeInit()
{
SetTimer("SecondsTimer", 1000, true);
SetTimer("MinutesTimer", 60000, true);
SetTimer("SecondsReset", 61000,true);
Seconds = 59;
Minutes = 9;
TimeTD = TextDrawCreate(11.000000, 173.000000,"~g~10 Minutes 59 Seconds, remaining for this round.");
TextDrawAlignment(TimeTD,0);
TextDrawBackgroundColor(TimeTD,0x000000ff);
TextDrawFont(TimeTD,1);
TextDrawLetterSize(TimeTD,1.699999,1.600000);
TextDrawColor(TimeTD,0x00ff0099);
TextDrawSetOutline(TimeTD,1);
TextDrawSetProportional(TimeTD,1);
TextDrawSetShadow(TimeTD,1);
return 1;
}

forward SecondsTimer();
public SecondsTimer()
{
Seconds--;
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
return 1;
}
forward MinutesTimer(playerid);
public MinutesTimer(playerid)
{
Minutes--;
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
return 1;
}
forward SecondsReset();
public SecondsReset()
{
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
Seconds = 60;
return 1;
}
Reply
#2

what if you do it like this
Код:
new Text:TimeTD;
new Seconds = 59;
new Minutes = 9;

public OnGameModeInit()
{
SetTimer("SecondsTimer", 1000, true);
//SetTimer("MinutesTimer", 60000, true);
//SetTimer("SecondsReset", 61000,true);
Seconds = 59;
Minutes = 9;
TimeTD = TextDrawCreate(11.000000, 173.000000,"~g~10 Minutes 59 Seconds, remaining for this round.");
TextDrawAlignment(TimeTD,0);
TextDrawBackgroundColor(TimeTD,0x000000ff);
TextDrawFont(TimeTD,1);
TextDrawLetterSize(TimeTD,1.699999,1.600000);
TextDrawColor(TimeTD,0x00ff0099);
TextDrawSetOutline(TimeTD,1);
TextDrawSetProportional(TimeTD,1);
TextDrawSetShadow(TimeTD,1);
return 1;
}

forward SecondsTimer();
public SecondsTimer()
{
Seconds--;
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
if(Seconds == 00) {
Minutes --;
Seconds = 60;
}
return 1;
}
/*forward MinutesTimer(playerid);
public MinutesTimer(playerid)
{
Minutes--;
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
return 1;
}
forward SecondsReset();
public SecondsReset()
{
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
Seconds = 60;
return 1;
}
*/
Reply
#3

Still, it goes like this :
Код:
Minutes : 7 Seconds : 01 remaining
Minutes : 7 Seconds : 00 remaining
Minutes : 7 Seconds : 59 remaining
Minutes : 7 Seconds : 58 remaining
Minutes : 7 Seconds : 57 remaining
Minutes : 6 Seconds : 56 remaining
Anyone? Sorry, but I'm really having a hard time
with these textdraws xD
Reply
#4

only have 1 timer for the countdown.

public SecondsTimer()
{
Seconds--;
if(Seconds <= -1)
{
Seconds = 59;
Minutes--;
}
new string[128];
format(string,sizeof(string),"~g~Minutes: %d Seconds: %d remaining",Minutes,Seconds);
TextDrawSetString(TimeTD,string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)