Textdraw overwrite textdraw
#1

Hello, I got text draw messages in my server and i made when player teleports to e.g. stunt it says: "nickname has teleported to Stunt". Problem is when player teleports to stunt it says his name, but his name overwrite other words. How can i make if name is longer it go to other way than other text is (if its possible, if not - any other solutions)? Heres code cut:

pawn Code:
if (strcmp("/stunt", cmdtext, true, 10) == 0)
{
new player[24];
GetPlayerName(playerid,player,sizeof(player));
format(tmp,sizeof(tmp),"%s",player,playerid);
Textdraw1 = TextDrawCreate(188.000000,429.000000,tmp);
TextDrawAlignment(Textdraw1,0);
TextDrawBackgroundColor(Textdraw1,0x000000ff);
TextDrawFont(Textdraw1,1);
TextDrawLetterSize(Textdraw1,0.499999,1.000000);
TextDrawColor(Textdraw1,0xffff00cc);
TextDrawSetOutline(Textdraw1,1);
TextDrawSetProportional(Textdraw1,1);
TextDrawSetShadow(Textdraw1,1);

TextDrawShowForAll(Text:0);
TextDrawShowForAll(Text:1);
TextDrawShowForAll(Text:2);
SetTimer("TextHide", 5000, false);
return 1;
}
P.S. its not all code.
Reply
#2

Come on, have you nothink me to suggest?
Reply
#3

Either plot it out better, Or make is so if thier name is longer than so many characters then it moves it over
Reply
#4

Quote:
Originally Posted by JeNkStAX
Either plot it out better, Or make is so if thier name is longer than so many characters then it moves it over
How can i do that, can you show example?
Reply
#5

Align it to the right?
Reply
#6

if( strval( player ) > 15 )
Now it will check if the name is bigger than 15 characters, just use ~n~ in the textdraw to create a new line.
Reply
#7

Quote:
Originally Posted by 0rb
Align it to the right?
How can i do that?

Quote:
Originally Posted by Marcel
if( strval( player ) > 15 )
Now it will check if the name is bigger than 15 characters, just use ~n~ in the textdraw to create a new line.
Where should i put that? If i use ~n~ it won't look good
Reply
#8

TextDrawAlignment :S
Reply
#9

Quote:
Originally Posted by Marcel
if( strval( player ) > 15 )
Now it will check if the name is bigger than 15 characters, just use ~n~ in the textdraw to create a new line.
its called strlen.
Reply
#10

I have improved message system little bit, but i still got one problem. It shows nickname perfectly, but when i leave the server and change my name to another one it shows old one and theres no matter how much time i change nickname it will still show first one. How can i fix that? Heres script:

pawn Code:
if (strcmp("/stunt", cmdtext, true, 10) == 0)
{
new player[24];
GetPlayerName(playerid,player,sizeof(player));
format(tmp,sizeof(tmp),"%s have joined /stunt",player,playerid);
Textdraw0 = TextDrawCreate(195.000000,429.000000,tmp);
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,1);
TextDrawLetterSize(Textdraw0,0.399999,1.000000);
TextDrawColor(Textdraw0,0xffff0099);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
TextDrawShowForAll(Text:0);
SetTimer("TextHide", 5000, false);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)