Attach3DTextLabelToPlayer
#6

Handle textlabels like this:

pawn Код:
new Text3D:label[MAX_PLAYERS],
    Admin[MAX_PLAYERS];

public OnGameModeInit()//just create it here, we update it later
{
    foreach(Player,i)
    {
        label[i] = Create3DTextLabel("", -1, 0, 0, 0, 10.0, 0, 0);
    }
    return 1;
}

public OnPlayerSpawn(playerid)//we update it on spawn and attach it to the player
{
    if(Admin[playerid]>0)//if player is admin, update the admin label
    {
        s[24];
        format(s, sizeof(s), "%s", Admin[playerid]);
        Update3DTextLabelText(label[playerid],-1,s);
    }
    else Update3DTextLabelText(label[playerid],-1," ");//else delete/emtpy it
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0, 0, 0.3);
    return 1;
}

//In case you want to "delete" the label, just empty it using:
Update3DTextLabelText(label[playerid], -1, " ");
This is an simple example, ofc you have to adjust this to your needs (change "label[playerid]" to your labelID ect).

This is a very simpel method and will work for sure!
I also had issues regarding this in the past but this method fixed it.

Hope this helps
Reply


Messages In This Thread
Attach3DTextLabelToPlayer - by Nourdin - 21.12.2013, 22:30
Re: Attach3DTextLabelToPlayer - by Nourdin - 21.12.2013, 23:53
Re: Attach3DTextLabelToPlayer - by ikey07 - 22.12.2013, 01:00
Re: Attach3DTextLabelToPlayer - by Nourdin - 22.12.2013, 12:28
Re: Attach3DTextLabelToPlayer - by CutX - 22.12.2013, 12:38
Re: Attach3DTextLabelToPlayer - by BlackWolf120 - 22.12.2013, 12:40
Re: Attach3DTextLabelToPlayer - by Nourdin - 22.12.2013, 12:44

Forum Jump:


Users browsing this thread: 1 Guest(s)