Problem with Textdraw
#1

Hello everybody.I create TextdrawBox in side text.But problem is in that.Box shows first and after it text.But in script is first text then box.Strange



Code:
pawn Код:
new Text:Stats[MAX_PLAYERS],
    Text:R_1[MAX_PLAYERS];
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2[MAX_PLAYERS];
new Text:Textdraw3[MAX_PLAYERS];

LoadTextdraws()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        Stats[i] = TextDrawCreate(506.000000, 387.000000, "~y~XP:        ~w~%d");
        TextDrawBackgroundColor(Stats[i], 255);
        TextDrawFont(Stats[i], 1);
        TextDrawLetterSize(Stats[i], 0.360000, 1.000000);
        TextDrawColor(Stats[i], -1);
        TextDrawSetOutline(Stats[i], 0);
        TextDrawSetProportional(Stats[i], 1);
        TextDrawSetShadow(Stats[i], 1);
        R_1[i] = TextDrawCreate(512.000000, 421.000000, "Rank:Commander of Army");
        TextDrawBackgroundColor(R_1[i], 255);
        TextDrawFont(R_1[i], 1);
        TextDrawLetterSize(R_1[i], 0.260000, 1.000000);
        TextDrawColor(R_1[i], -1);
        TextDrawSetOutline(R_1[i], 0);
        TextDrawSetProportional(R_1[i], 1);
        TextDrawSetShadow(R_1[i], 1);

        Textdraw2[i] = TextDrawCreate(521.000000, 363.000000, "~g~Kills:        ~w~%d");
        TextDrawBackgroundColor(Textdraw2[i], 255);
        TextDrawFont(Textdraw2[i], 1);
        TextDrawLetterSize(Textdraw2[i], 0.340000, 1.000000);
        TextDrawColor(Textdraw2[i], -1);
        TextDrawSetOutline(Textdraw2[i], 0);
        TextDrawSetProportional(Textdraw2[i], 1);
        TextDrawSetShadow(Textdraw2[i], 1);

        Textdraw3[i] = TextDrawCreate(506.000000, 375.000000, "~r~Deaths:        ~w~%d");
        TextDrawBackgroundColor(Textdraw3[i], 255);
        TextDrawFont(Textdraw3[i], 1);
        TextDrawLetterSize(Textdraw3[i], 0.340000, 1.000000);
        TextDrawColor(Textdraw3[i], -1);
        TextDrawSetOutline(Textdraw3[i], 0);
        TextDrawSetProportional(Textdraw3[i], 1);
        TextDrawSetShadow(Textdraw3[i], 1);
    }
    Textdraw0 = TextDrawCreate(500.000000, 352.000000, "_");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 0.500000, 10.000000);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 170);
    TextDrawTextSize(Textdraw0, 635.000000, 0.000000);

    Textdraw1 = TextDrawCreate(536.000000, 350.000000, "Stats");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 2);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
   
    return 1;

}
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
    TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    SetPlayerInterior(playerid, 0);
    TextDrawShowForPlayer(playerid,Text:Textdraw0);
    return 1;
}
Please reply fast.Thanks
Reply
#2

Maybe try to show TextDraw0 first then the other textdraws
Like:
Код:
TextDrawShowForPlayer(playerid,Text:Textdraw0);
TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
    TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    SetPlayerInterior(playerid, 0);
Reply
#3

Same problem...
Reply
#4

Maybe try this:
Код:
Textdraw1 = TextDrawCreate(536.000000, 350.000000, "Stats~n~~n~~n~~n~~n~~n~~n~");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 2);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawUseBox(Textdraw1, 1);
    TextDrawBoxColor(Textdraw1, 170);
And
Код:
//TextDrawShowForPlayer(playerid,Text:Textdraw0);
TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
    TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    SetPlayerInterior(playerid, 0);
Because i made menu's to and i make the box to with the title.
Reply
#5

Quote:
Originally Posted by admigo
Посмотреть сообщение
Maybe try this:
Код:
Textdraw1 = TextDrawCreate(536.000000, 350.000000, "Stats~n~~n~~n~~n~~n~~n~~n~");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 2);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 170);
And
Код:
//TextDrawShowForPlayer(playerid,Text:Textdraw0);
TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
    TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    SetPlayerInterior(playerid, 0);
Because i made menu's to and i make the box to with the title.
It`s shows me normal.But without box.But I saw in code you enable box..
Reply
#6

Quote:
Originally Posted by admigo
Посмотреть сообщение
Maybe try this:
Код:
Textdraw1 = TextDrawCreate(536.000000, 350.000000, "Stats~n~~n~~n~~n~~n~~n~~n~");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 2);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawUseBox(Textdraw1, 1);
    TextDrawBoxColor(Textdraw1, 170);
And
Код:
//TextDrawShowForPlayer(playerid,Text:Textdraw0);
TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
    TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    SetPlayerInterior(playerid, 0);
Because i made menu's to and i make the box to with the title.
Edited:forgot to change the textdraw id lol
Reply
#7

Textdraws are ordered in the way they are created. The one created first will be at the bottom, the one created last will be on top. Create the box first, then the text.
Reply
#8

Quote:
Originally Posted by admigo
Посмотреть сообщение
Edited:forgot to change the textdraw id lol
Which one to comment and which to set like box?
Reply
#9

Hello??!! Anyone can help me
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)