[HELP] TextDraw
#1

Okay, here'e my code (I use SetTimer in OnGameModeInit wich repeats every second)

pawn Код:
new string[128];
    TextDrawDestroy(DateAndTime);
    format(string, sizeof(string), "%02d/%02d/%02d-%02d:%02d~n~", xDay, xMonth, xYear, xHour, xMinute);
    DateAndTime = TextDrawCreate(498.000000, 2.000000, string);
    TextDrawBackgroundColor(DateAndTime, 255);
    TextDrawFont(DateAndTime, 1);
    TextDrawLetterSize(DateAndTime, 0.360000, 2.200000);
    TextDrawColor(DateAndTime, -1);
    TextDrawSetOutline(DateAndTime, 1);
    TextDrawSetProportional(DateAndTime, 1);
             TextDrawShowForAll(DateAndTime);
The problem is, the TextDraw flashes... it shows the correct time and date but it disapears and appears all the time with 1 second in between..
Reply
#2

Don't Create new textdraw each second, use TextDrawSetString,

on game mode init CreateTextDraw and in Timer only SetString
Reply
#3

oh, thanks <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)