string
#1

How to use strings is text draw?
Maybe like this?


Quote:

format(string, sizeof(string), "%s, welcome to server", playername);
TextDrawCreate (y, x, string);

Or?
Reply
#2

Use TextDrawSetString.
________
AMETUER XXX
Reply
#3

Can I see example?
Reply
#4

pawn Код:
format( string, sizeof string, "%s, welcome to server", playername );
TextDrawSetString( YourTextDraw, string );
________
Free Burger King Gift Cards
Reply
#5

So I dont need to use "TextDrawCreate"?
Reply
#6

Ofcourse you need to use TextDrawCreate, it's just that you have to use TextDrawSetString if you want to change the string used as a textdraw.

And yes, you can use format, and put it in a Textdraw
Reply
#7

So, sorry I am not so good:

Код:
format( string, sizeof string, "%s, welcome to server", playername );
TextDrawSetString( YourTextDraw, string );
TextDrawCreate (x, y, what here?);
Reply
#8

Quote:
Originally Posted by Ironboy500
So, sorry I am not so good:

Код:
format( string, sizeof string, "%s, welcome to server", playername );
TextDrawSetString( YourTextDraw, string );
TextDrawCreate (x, y, what here?);
You need to create the Textdraw under OnGameModeInit.
Reply
#9

I asked what should I put under TextDrawCreate after I used TextDrawSetString and format?
Reply
#10

You don't use TextDrawSetString the first time, as I tried to explain.
You use TextDrawCreate, but if you want to CHANGE the string of the textdraw, THEN you use TextDrawSetString to change it, instead of destroying the textdraw, and recreate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)