textdraw problem
#1

Why this script only creates last placed textdraw?


pawn Код:
stock taxitextdraw(playerid)
{
                textdraws[TextdrawTAXIname][playerid] = TextDrawCreate(543.000000, 320.000000, "no client");
                TextDrawBackgroundColor(textdraws[TextdrawTAXIname][playerid], 255);
                TextDrawFont(textdraws[TextdrawTAXIname][playerid], 1);
                TextDrawLetterSize(textdraws[TextdrawTAXIname][playerid], 0.200000, 1.100000);
                TextDrawColor(textdraws[TextdrawTAXIname][playerid], -1);
                TextDrawSetOutline(textdraws[TextdrawTAXIname][playerid], 1);
                TextDrawSetProportional(textdraws[TextdrawTAXIname][playerid], 1);
                TextDrawShowForPlayer(playerid, textdraws[TextdrawTAXIname][playerid]);
               
                textdraws[TextdrawTAXI1][playerid] = TextDrawCreate(542.000000, 336.000000, "0 ");
                TextDrawBackgroundColor(textdraws[TextdrawTAXI1][playerid], 255);
                TextDrawFont(textdraws[TextdrawTAXI1][playerid], 1);
                TextDrawLetterSize(textdraws[TextdrawTAXI1][playerid], 0.200000, 1.100000);
                TextDrawColor(textdraws[TextdrawTAXI1][playerid], -65281);
                TextDrawSetOutline(textdraws[TextdrawTAXI1][playerid], 1);
                TextDrawSetProportional(textdraws[TextdrawTAXI1][playerid], 1);
                TextDrawShowForPlayer(playerid, textdraws[TextdrawTAXI1][playerid]);

                textdraws[TextdrawTAXIkur][playerid] = TextDrawCreate(542.000000, 352.000000, "place");
                TextDrawBackgroundColor(textdraws[TextdrawTAXIkur][playerid], 255);
                TextDrawFont(textdraws[TextdrawTAXIkur][playerid], 1);
                TextDrawLetterSize(textdraws[TextdrawTAXIkur][playerid], 0.200000, 1.100000);
                TextDrawColor(textdraws[TextdrawTAXIkur][playerid], -65281);
                TextDrawSetOutline(textdraws[TextdrawTAXIkur][playerid], 1);
                TextDrawSetProportional(textdraws[TextdrawTAXIkur][playerid], 1);
                TextDrawShowForPlayer(playerid, textdraws[TextdrawTAXIkur][playerid]);
                return 1;
}
This stock is used on OnDialogResponse.
Reply
#2

can you show us what values these variables (TextdrawTAXIname, TextdrawTAXIbabkes, TextdrawTAXIkur) takes ? cuz if they take the same value (eg: all initialized at 0), then u're just storing all textdraw IDs on the same variable which will get only the last one to be showen
Reply
#3

pawn Код:
//called when taxi driver get's a passenger
TextDrawSetString(textdraws[TextdrawTAXIname][driver], pName(i));
TextDrawShowForPlayer(driver, textdraws[TextdrawTAXIname][driver]);

//used with 5ms timer
TextDrawSetString(textdraws[TextdrawTAXI1][driver], money);
TextDrawShowForPlayer(driver, textdraws[TextdrawTAXI1][driver]);

// used on dialog response
TextDrawSetString(textdraws[TextdrawTAXIkur][driver], inputtext);
TextDrawShowForPlayer(driver, textdraws[TextdrawTAXIkur][driver]);


stock pName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}
Reply
#4

no, i meant show me where do u set the values of the variables mentioned in my first reply
Reply
#5

you mean this?

pawn Код:
enum textdrawdata
{

Text:TextdrawTAXIname[MAX_PLAYERS] = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI1[MAX_PLAYERS] = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXIkur[MAX_PLAYERS] = Text:INVALID_TEXT_DRAW,


}
new textdraws[textdrawdata];
Reply
#6

apart than that, u dont set their values anywhere in ur script ? if so then the problem is the one i mentioned in the first post
to fix it, try changing each of their values, set them to 1, 2 and 3 for example
Reply
#7

No i don't.

When i try to set values i get tag mismatch

textdraws[TextdrawTAXIname][playerid] = 1000;
textdraws[TextdrawTAXIname][playerid] = TextDrawCreate.....

or maybe i misunderstanding what you mean

Any example?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)