SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/05/2012, 10:38 AM   #1
SpiderWalk
Gangsta
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 970
Reputation: 26
Default Problem with Textdraw

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 Code:
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
SpiderWalk is offline   Reply With Quote
Old 13/05/2012, 10:44 AM   #2
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Re: Problem with Textdraw

Maybe try to show TextDraw0 first then the other textdraws
Like:
Code:
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);
__________________
Follow me on Instagram @brandonvanommen
Admigo is offline   Reply With Quote
Old 13/05/2012, 10:46 AM   #3
SpiderWalk
Gangsta
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 970
Reputation: 26
Default Re: Problem with Textdraw

Same problem...
SpiderWalk is offline   Reply With Quote
Old 13/05/2012, 10:50 AM   #4
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Re: Problem with Textdraw

Maybe try this:
Code:
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
Code:
//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.
__________________
Follow me on Instagram @brandonvanommen

Last edited by Admigo; 13/05/2012 at 11:21 AM.
Admigo is offline   Reply With Quote
Old 13/05/2012, 11:13 AM   #5
SpiderWalk
Gangsta
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 970
Reputation: 26
Default Re: Problem with Textdraw

Quote:
Originally Posted by admigo View Post
Maybe try this:
Code:
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
Code:
//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..
SpiderWalk is offline   Reply With Quote
Old 13/05/2012, 11:17 AM   #6
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Re: Problem with Textdraw

Quote:
Originally Posted by admigo View Post
Maybe try this:
Code:
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
Code:
//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
__________________
Follow me on Instagram @brandonvanommen
Admigo is offline   Reply With Quote
Old 13/05/2012, 02:53 PM   #7
SpiderWalk
Gangsta
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 970
Reputation: 26
Default Re: Problem with Textdraw

Quote:
Originally Posted by admigo View Post
Edited:forgot to change the textdraw id lol
Which one to comment and which to set like box?
SpiderWalk is offline   Reply With Quote
Old 13/05/2012, 11:53 AM   #8
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,068
Reputation: 2655
Default Re: Problem with Textdraw

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.
__________________
Vince is offline   Reply With Quote
Old 13/05/2012, 04:58 PM   #9
SpiderWalk
Gangsta
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 970
Reputation: 26
Default Re: Problem with Textdraw

Hello??!! Anyone can help me
SpiderWalk is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textdraw problem [Small problem] [+rep] Twinki1993 Scripting Help 8 03/02/2012 02:54 AM
Textdraw Problem tony_fitto Help Archive 0 26/04/2011 01:25 PM
Textdraw problem.. BuLLeT[LTU] Help Archive 4 26/01/2011 03:43 PM
textdraw problem jaksimaksi Help Archive 3 08/01/2011 03:18 PM
TextDraw problem Razvann Help Archive 2 09/01/2010 04:58 PM


All times are GMT. The time now is 01:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.