SA-MP Forums Archive
Textdraw overwrite textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw overwrite textdraw (/showthread.php?tid=65076)



Textdraw overwrite textdraw - fiordas - 09.02.2009

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.



Re: Textdraw overwrite textdraw - fiordas - 09.02.2009

Come on, have you nothink me to suggest?


Re: Textdraw overwrite textdraw - ICECOLDKILLAK8 - 09.02.2009

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


Re: Textdraw overwrite textdraw - fiordas - 09.02.2009

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?


Re: Textdraw overwrite textdraw - yom - 09.02.2009

Align it to the right?


Re: Textdraw overwrite textdraw - Marcel - 09.02.2009

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.


Re: Textdraw overwrite textdraw - fiordas - 10.02.2009

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


Re: Textdraw overwrite textdraw - yom - 10.02.2009

TextDrawAlignment :S


Re: Textdraw overwrite textdraw - kc - 10.02.2009

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.


Re: Textdraw overwrite textdraw - fiordas - 10.02.2009

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;
}