[Help] UpdatePlayer3DTextLabelText
#1

HI, I'm trying to make the text label in top of my head update but I can't. I'm not sure what I'm doing wrong but the text wont update. I tried everything but no luck. Here's what I got..


This creates the text label. (it works)
pawn Код:
dcmd_test(playerid,params[])
  {

  if(!strlen(params)) return SendClientMessage(playerid, red, "empty..");
       
  new string[128];
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);

  textlabel[playerid] = PlayerText3D:Create3DTextLabel(params, green, x, y, z, 40.0, 0, 0);

  Attach3DTextLabelToPlayer(Text3D:textlabel[playerid], playerid, 0.0, 0.0, 0.3);
       
  return 1;
       
  }
The update. (not working)
pawn Код:
dcmd_update(playerid,params[])
  {
   if(!strlen(params)) return SendClientMessage(playerid, red, "empty..");
   UpdatePlayer3DTextLabelText(playerid, textlabel[playerid], yellow, params);
   return 1;
  }
I also did it like this

UpdatePlayer3DTextLabelText(playerid, PlayerText3D:textlabel[playerid], yellow, params); Like the wiki (https://sampwiki.blast.hk/wiki/UpdatePlayer3DTextLabelText) but it doesn't work.

Thank you in advance for any help.
Reply
#2

Try this:
pawn Код:
dcmd_test(playerid,params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, red, "empty..");    
    new string[128];
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    textlabel[playerid] = Create3DTextLabel(params, green, x, y, z, 40.0, 0, 0);
    Attach3DTextLabelToPlayer(textlabel[playerid], playerid, 0.0, 0.0, 0.3);    
    return 1;
}
Reply
#3

Quote:
Originally Posted by bogeyman_EST
Try this:
pawn Код:
dcmd_test(playerid,params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, red, "empty..");    
    new string[128];
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    textlabel[playerid] = Create3DTextLabel(params, green, x, y, z, 40.0, 0, 0);
    Attach3DTextLabelToPlayer(textlabel[playerid], playerid, 0.0, 0.0, 0.3);    
    return 1;
}
That doesn't work, you just copy the same thing I had but removed Text3D: from it, and that will not even work. If I do what you did it (with the working code) will just create a text in top of the text I already had. That's why I want/need to use UpdatePlayer3DTextLabelText.
Reply
#4

I'm still with the same problem. Help please.
Reply
#5

pawn Код:
Update3DTextLabelText(textlabel[playerid], yellow, params);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)