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



(Problem)Attach3DTextLabelToPlayer - ordixp - 17.10.2009

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



Re: (Problem)Attach3DTextLabelToPlayer - Beaver07 - 18.10.2009

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



Re: (Problem)Attach3DTextLabelToPlayer - Snyper1 - 18.10.2009

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


Re: (Problem)Attach3DTextLabelToPlayer - xMine - 18.10.2009

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);


Re: (Problem)Attach3DTextLabelToPlayer - _ReloadeD_ - 18.10.2009

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


Re: (Problem)Attach3DTextLabelToPlayer - xMine - 18.10.2009

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