30.08.2018, 22:43
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?
new Time, TimeM, TimeS; new Text:Textdraw0;
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);
TextDrawShowForPlayer(playerid, Textdraw0);
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; }