Name tag
#10

It's not showing because you set the coordinates wrong. You must attach it to player's current coordinates with a little boost of Z coordinate:

pawn Код:
new Float: posX, Float: posY, Float: posZ;
       
    GetPlayerPos (playerid, posX, posY, posZ);
               
    new Text3D:label = Create3DTextLabel("Donating Player", RED, posX, posY, posZ + 0.5, 40.0, 0);
    Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
Anyway, doing it this way, you won't be able to delete the text when a donator disconnects. In order to fix this, you need to create a global array:

pawn Код:
new Text3D:donatorText[MAX_PLAYERS];

    <..> when a donator connects

    new Float: posX, Float: posY, Float: posZ;
       
    GetPlayerPos (playerid, posX, posY, posZ);

    donatorText [playerid] = Create3DTextLabel ("Donating Player", RED, posX, posY, posZ + 0.5, 40.0, 0);
    Attach3DTextLabelToPlayer (donatorText [playerid], playerid, 0.0, 0.0, 0.7);

    <...> when a donator disconnects

    Delete3DTextLabel (donatorText [playerid]);
Reply


Messages In This Thread
Name tag - by STONEGOLD - 06.07.2015, 19:56
Re: Name tag - by b3nz - 06.07.2015, 20:11
Re: Name tag - by STONEGOLD - 06.07.2015, 20:18
Re: Name tag - by Sime30 - 06.07.2015, 20:21
Re: Name tag - by suni - 06.07.2015, 22:12
Re: Name tag - by STONEGOLD - 06.07.2015, 22:19
Re: Name tag - by suni - 06.07.2015, 22:21
Re: Name tag - by STONEGOLD - 06.07.2015, 22:40
Re: Name tag - by suni - 06.07.2015, 22:53
Re: Name tag - by b3nz - 06.07.2015, 22:57

Forum Jump:


Users browsing this thread: 3 Guest(s)