(Problem)Attach3DTextLabelToPlayer
#1

I would like the text attached to the player who made the cmd. But this does not work ...

Код:
  if(strcmp(cmdtext, "/playerlabel", true) == 0)
{
  new PlayerText3D:playertextid;
  new Float:X, Float:Y, Float:Z;
  GetPlayerPos(playerid, X, Y, Z );
  playertextid = CreatePlayer3DTextLabel(playerid,"Hello\nI'm at your position",0x008080FF,X,Y,Z,1000.0);
  Attach3DTextLabelToPlayer(playertextid, playerid, X,Y,Z);
  return 1;
}
Thanks you for your help :P
Reply
#2

Well the way i've attached 3DTexts to my players is
Код:
new Text3D:Player[MAX_PLAYERS]; // This goes at the top of the script
then i'll use the cmd as an example
Код:
if(strcmp(cmdtext, "/playerlabel", true) == 0)
{
  Player[playerid] = Create3DTextLabel("Hello",COLOR_WHITE,0,0,0,15,0,1);
  Attach3DTextLabelToPlayer(Player[playerid],playerid,0,0,0.30);
  return 1;
}
That should work and if you wish to change their 3dtext just use
Код:
Update3DTextLabelText(Player[playerid],GetPlayerColor(playerid),"You updated me"); // Getplayercolor will only return a color if setplayercolor was used before
Reply
#3

That sucks . Would have been nice to always have updates or whatever for you to see.
Reply
#4

Oh, and there is a mistake:
Attach3DTextLabelToPlayer(playertextid, playerid, X,Y,Z);

X, Y and Z are offsets!
So do something like this:
Attach3DTextLabelToPlayer(playertextid, playerid, 0.0, 0.0, 2.0);
Reply
#5

i don't understand wht it's do?? write a text like TEXTDRAW?
Reply
#6

Yeah, its kinda like a text draw, but its in the 3d space so you can put everywhere you like.
They're like the nametags over the players head but you can put them somewhere else
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)