help textdraw
#1

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);
Reply
#2

Use TextDrawShowForPlayer OnPlayerConnect and TextDrawHideForPlayer when you want to hide it.

TextDrawShowForPlayer(playerid, Textjoinzone[0]);
Reply
#3

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?
Reply
#4

Quote:
Originally Posted by Pluslegendary
Посмотреть сообщение
Could you give me an example?
I gave you the example already. Put that code under OnPlayerConnect callback.
Reply
#5

Quote:
Originally Posted by Kyle
Посмотреть сообщение
I gave you the example already. Put that code under OnPlayerConnect callback.
the text drawing does not appear
Reply
#6

Add this one too:

TextDrawShowForPlayer(playerid, Textjoinzone[1]);
Reply
#7

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 ?
Reply
#8

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?
Reply
#9

Код:
    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.
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)