Well, firstly, you would need to get the textdraw info using the link that Mansonh posted, it should look something like:
pawn Код:
new Text:Textdraw0;
// In OnGameModeInit prefferably, we procced to create our textdraws:
Textdraw0 = TextDrawCreate(17.000000, 429.000000, "Timeleft: 432423");
TextDrawBackgroundColor(Textdraw0, 65535);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, 16777215);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Now, what we do from here is add the timer.
pawn Код:
new Timer;
new TimeM, TimeS;
public OnPlayerEnterCheckpoint(playerid)
{
//your textdraw stuff
Timer = SetTimer("UpdateTD",1000, true);
TimeM = 0/*However many minutes you want the timer to go for*/;
TimeS = 30/*However many seconds you want the timer to go for*/;
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
KillTimer(Timer);
TextDrawHideForAll(Textdraw0);
//Kill the timer because the player exited the CP.
return 1;
}
forward UpdateTD();
public UpdateTD()
{
TimeS --;
if(TimeS == 0 && TimeM == 0)
{
//The player has been in the CP long enough, the round ends?
}
new Str[35];
if(TimeS < 10) format(Str, 35, "%d:0%d", TimeM, TimeS);
if(TimeS > 9) format(Str, 35, "%d:%d", TimeM, TimeS);
TextDrawSetString(Textdraw0, Str);
return 1;
}