SA-MP Forums Archive
[HELP] TextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] TextDraw (/showthread.php?tid=168514)



[HELP] TextDraw - Lorrden - 16.08.2010

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..


Re: [HELP] TextDraw - ikey07 - 16.08.2010

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

on game mode init CreateTextDraw and in Timer only SetString


Re: [HELP] TextDraw - Lorrden - 16.08.2010

oh, thanks <3