Textdraw nessed up
#1

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];
Reply
#2

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;
Reply
#3

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
Reply
#4

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

I did that and it still bugs.
Reply
#6

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

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

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

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

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

//when deleting
TextDrawDestroy(Textdraw1);
Textdraw1 = INVALID_TEXT_DRAW;
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)