help 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)
+--- Thread: help textdraw (
/showthread.php?tid=643024)
help textdraw -
Pluslegendary - 11.10.2017
I am creating a textdraw that shows that users who have logged in, pero tengo una pregunta como hago la funciуn para mostrar el texto dibujado cuando el usuario se conectav, the truth is that I only have the text drawn and I would like someone to help me with the code to display when I connect as this photo
The text draw is
Код:
Textjoinzone[0] = TextDrawCreate(5.153693, 425.250091, "[Zone]: El equipo %d ha capturado la zona %d");
TextDrawLetterSize(Textjoinzone[0], 0.297261, 0.614166);
TextDrawAlignment(Textjoinzone[0], 1);
TextDrawColor(Textjoinzone[0], -1);
TextDrawSetShadow(Textjoinzone[0], 0);
TextDrawSetOutline(Textjoinzone[0], 1);
TextDrawBackgroundColor(Textjoinzone[0], 51);
TextDrawFont(Textjoinzone[0], 1);
TextDrawSetProportional(Textjoinzone[0], 1);
Textjoinzone[1] = TextDrawCreate(5.622294, 435.166839, "[join]: el usuario %d se ha conectado");
TextDrawLetterSize(Textjoinzone[1], 0.260248, 0.742498);
TextDrawAlignment(Textjoinzone[1], 1);
TextDrawColor(Textjoinzone[1], -1);
TextDrawSetShadow(Textjoinzone[1], 0);
TextDrawSetOutline(Textjoinzone[1], 1);
TextDrawBackgroundColor(Textjoinzone[1], 51);
TextDrawFont(Textjoinzone[1], 1);
TextDrawSetProportional(Textjoinzone[1], 1);
Re: help textdraw -
Kyle - 11.10.2017
Use TextDrawShowForPlayer OnPlayerConnect and TextDrawHideForPlayer when you want to hide it.
TextDrawShowForPlayer(playerid, Textjoinzone[0]);
Re: help textdraw -
Pluslegendary - 11.10.2017
Quote:
Originally Posted by Kyle
Use TextDrawShowForPlayer OnPlayerConnect and TextDrawHideForPlayer when you want to hide it.
TextDrawShowForPlayer(playerid, Textjoinzone[0]);
|
Could you give me an example?
Re: help textdraw -
Kyle - 11.10.2017
Quote:
Originally Posted by Pluslegendary
Could you give me an example?
|
I gave you the example already. Put that code under OnPlayerConnect callback.
Re: help textdraw -
Pluslegendary - 11.10.2017
Quote:
Originally Posted by Kyle
I gave you the example already. Put that code under OnPlayerConnect callback.
|
the text drawing does not appear
Re: help textdraw -
Kyle - 11.10.2017
Add this one too:
TextDrawShowForPlayer(playerid, Textjoinzone[1]);
Re: help textdraw -
Maximun - 11.10.2017
Quote:
Originally Posted by Kyle
Add this one too:
TextDrawShowForPlayer(playerid, Textjoinzone[1]);
|
So it will be disappear at the same time
@Pluslegendary, what do you need exactly ? because @Kyle has explained you everything about textdraw
When the player connect, the textdraw doesn't even appear as you said, at the same time you want to display it? isn't ?
Re: help textdraw -
Pluslegendary - 11.10.2017
Quote:
Originally Posted by Kyle
Add this one too:
TextDrawShowForPlayer(playerid, Textjoinzone[1]);
|
another question, how can i do to get the username in the textdraw?
Re: help textdraw -
Kyle - 11.10.2017
Код:
new newtext[41], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(newtext, sizeof(newtext), "[join]: el usuario %s se ha conectado", name);
TextDrawSetString(Textjoinzone[1], newtext);
TextDrawShowForPlayer(playerid, Textjoinzone[0]);
TextDrawShowForPlayer(playerid, Textjoinzone[1]);
* Disclaimer, code copied from the wiki and edited.
Re: help textdraw -
Pluslegendary - 11.10.2017
Quote:
Originally Posted by Kyle
Код:
new newtext[41], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(newtext, sizeof(newtext), "[join]: el usuario %s se ha conectado", name);
TextDrawSetString(Textjoinzone[1], newtext);
TextDrawShowForPlayer(playerid, Textjoinzone[0]);
TextDrawShowForPlayer(playerid, Textjoinzone[1]);
* Disclaimer, code copied from the wiki and edited.
|
Where can I add that?