How to i can
#1

How to i can creating a time textdraws? Such as 05:00 When ending the timer the player must die how to do this with TEXTDRAWS?
Reply
#2

By using format and TextDrawSetString
Reply
#3

Create your textdraw and set a timer that repeats every second where you decrease the time everytime its called and use TextDrawSetString
Reply
#4

I got this code from an old help thread. Credits to @Jeffry


At top of your script.
Код:
 
new Time, TimeM, TimeS;
new Text:Textdraw0;
OnFilterScriptInit/OnGameModeInit (The textdraw used here is just a example)
Код:
Textdraw0 = TextDrawCreate(17.000000, 429.000000, "20:00");
TextDrawBackgroundColor(Textdraw0, 65535);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, 16777215);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
TimeM = 20; 
TimeS = 0;
Time = SetTimer("UpdateTime", 1000, true);
OnPlayerConnect
Код:
TextDrawShowForPlayer(playerid, Textdraw0);
On Bottom of your script
Код:
forward UpdateTime();
public UpdateTime()
{
  new Str[34];
  TimeS --;
  if(TimeM == 0 && TimeS == 0)
  {
    KillTimer(Time);
  }
  if(TimeS == -1)
  {
    TimeM--;
    TimeS = 59;
  }
  format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
  TextDrawSetString(Textdraw0, Str);
  return 1;
}
Good Luck. Hope you understand.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)