SA-MP Forums Archive
Textdraw nessed up - 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: Textdraw nessed up (/showthread.php?tid=260847)



Textdraw nessed up - bartje01 - 10.06.2011

Hey all. My textdraw for score is messed up.
It is mixing with other players their textdraw.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
        {
        TextDrawSetString(Textdraw1[i], String);
        }
pawn Код:
new Text:Textdraw1[MAX_PLAYERS];



Re: Textdraw nessed up - Donya - 11.06.2011

initiate all textdraws like this.
pawn Код:
#undef INVALID_TEXT_DRAW
#define INVALID_TEXT_DRAW       Text:0xFFFF

new Text:Textdraw1[MAX_PLAYERS] = {INVALID_TEXT_DRAW,...};
new Text:Textdraw1 = INVALID_TEXT_DRAW;



Re: Textdraw nessed up - bartje01 - 11.06.2011

Quote:
Originally Posted by Donya
Посмотреть сообщение
initiate all textdraws like this.
pawn Код:
#undef INVALID_TEXT_DRAW
#define INVALID_TEXT_DRAW       Text:0xFFFF

new Text:Textdraw1[MAX_PLAYERS] = {INVALID_TEXT_DRAW,...};
new Text:Textdraw1 = INVALID_TEXT_DRAW;
Hmm I dont really understand that. :S
You can just use new Text:Textdraw1 once. not Twice? 0- 0xD


Re: Textdraw nessed up - Donya - 11.06.2011

i meant for future textdraws, also after using textdrawdestroy, set their values to invalid_text_draw


Re: Textdraw nessed up - bartje01 - 11.06.2011

I did that and it still bugs.


Re: Textdraw nessed up - Donya - 11.06.2011

did u set all your textdraws to invalid_text_draw? and is it happening instantly or after awhile


Re: Textdraw nessed up - bartje01 - 11.06.2011

And how will I manage to use that here? :O

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
        {
        TextDrawSetString(Textdraw1[i], String);
     }



Re: Textdraw nessed up - Donya - 11.06.2011

pawn Код:
//when creating
new Text:Textdraw1 = INVALID_TEXT_DRAW;

//when setting or anything else.
Textdraw1 = TextDrawCreate(...);

//when deleting
TextDrawDestroy(Textdraw1);
Textdraw1 = INVALID_TEXT_DRAW;



Re: Textdraw nessed up - bartje01 - 11.06.2011

Still doesnt work. This is everything of my textdraw.
on top
pawn Код:
#undef INVALID_TEXT_DRAW
#define INVALID_TEXT_DRAW       Text:0xFFFF
new Text:Textdraw1 = INVALID_TEXT_DRAW;
ongamemodeinit
pawn Код:
Textdraw0 = TextDrawCreate(1.000000,437.000000,"Score");
    Textdraw1 = TextDrawCreate(121.000000,435.000000,"1");
    TextDrawUseBox(Textdraw0,1);
   
   
    TextDrawAlignment(Textdraw1,0);
   
    TextDrawBackgroundColor(Textdraw1,0x000000ff);
    TextDrawFont(Textdraw0,3);
   
    TextDrawFont(Textdraw1,3);
    TextDrawLetterSize(Textdraw1,0.699999,1.500000);
   
    TextDrawColor(Textdraw1,0xffffffff);
   
    TextDrawSetOutline(Textdraw1,1);
   
    TextDrawSetProportional(Textdraw1,1);
   
    TextDrawSetShadow(Textdraw1,1);
OnPlayerSpawn
pawn Код:
TextDrawShowForPlayer(playerid, Textdraw1);
This at my timer
pawn Код:
TextDrawSetString(Textdraw1, String);
Still mixing with other players