28.05.2010, 02:37
Okay, so I've got a little problem on textdraws.
Well, see, I've created a timer textdraw but this
happens everytime...
You get my point
Heres the code :
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
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;
}