SA-MP Forums Archive
string - 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: string (/showthread.php?tid=113271)



string - Ironboy500 - 13.12.2009

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?


string - [NoV]LaZ - 13.12.2009

Use TextDrawSetString.
________
AMETUER XXX


Re: string - Ironboy500 - 13.12.2009

Can I see example?


string - [NoV]LaZ - 13.12.2009

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


Re: string - Ironboy500 - 13.12.2009

So I dont need to use "TextDrawCreate"?


Re: string - LarzI - 13.12.2009

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


Re: string - Ironboy500 - 13.12.2009

So, sorry I am not so good:

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



Re: string - Abernethy - 13.12.2009

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.


Re: string - Ironboy500 - 13.12.2009

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


Re: string - LarzI - 13.12.2009

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.