24.08.2011, 00:45
(
Last edited by Tigerbeast11; 24/08/2011 at 11:29 AM.
Reason: [SOLVED]
)
I have a textdraw with a timer:
Textdraw properties:
Timer:
Timer function:
When I go ingame, all I see is 15:00 and they timer doesn't count down! Please help me!
pawn Code:
new GameMinutes = 14;
new GameSeconds = 59;
new Text:Textdraw0;
pawn Code:
Textdraw0 = TextDrawCreate(86.000000,427.000000,"15:00");
TextDrawAlignment(Textdraw0,2);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.499999,2.000000);
TextDrawColor(Textdraw0,0xffffffff);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
pawn Code:
SetTimer("GameTime",1000,1);
pawn Code:
public GameTime()
{
if(GameSeconds > 0 || GameMinutes > 0)
{
GameSeconds--;
if(GameSeconds <= -1)
{
GameMinutes--;
GameSeconds=59;
}
new TimeString[14];
format(TimeString,sizeof(TimeString),"%02d:%02d",GameMinutes,GameSeconds);
TextDrawSetString(Textdraw0,TimeString);
}
if(GameSeconds == 0 && GameMinutes == 0)
{
OnGameModeExit();
}
return 1;
}