04.07.2011, 08:10
Untested
pawn Код:
//At top
new CD;
new CDTimer;
//OnGameModeInit
new Text:CDTextDraw;
CDTextDraw = TextDrawCreate(240.0, 580.0, "_");
//In your command (To start the count down)
CD = 15;
TextDrawShowForAll(CDTextDraw);
CDTimer = SetTimer("CountDown", 1000, true);
//Somewhere in ur script but now in any callbacks
forward CountDown();
public CountDown()
{
if(CD != 0)
{
new string[6];
format(string, sizeof(string), "%02d", CD);
TextDrawSetString(CDTextDraw, string);
CD --;
}
else
{
KillTimer(CDTimer);
TextDrawSetString(CDTextDraw, "CD stopped");
}
return 1;
}