Player3DLabels.
#1

I've got a problem with my displaying of 3D Text Labels not showing when I ask them to be.

Here is what I have:

pawn Код:
command(mask, playerid, params[])
{
    if(Player[playerid][Level] >= 5)
    {
        if(Player[playerid][Mask] == 1)
        {
            if(MaskOn[playerid] == 0)
            {
                new string[256];
                MaskOn[playerid] = 1;
                new rand = 1000 + random(8999);
                MaskNumber[playerid] = rand;
                format(string, sizeof(string), "* %s takes out a mask and places it over their head. *", MaskOnOff(playerid));
                CloseMessage(playerid, ACTION, string);
                format(string, sizeof(string), "Stranger_%d", MaskNumber[playerid]);
                Update3DTextLabelText(masklabel[playerid], GREY, string);
                Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
                for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
            }
            else return SendClientMessage(playerid, WHITE, "You already have your mask on.");
        }
        else return SendClientMessage(playerid, WHITE, "You don't have a Mask.");
    }
    else return SendClientMessage(playerid, WHITE, "You must be level 5 and above to use a mask.");
    return 1;
}
Above is the command to get them to be attatched to the player.

Here is OnPlayerConnect:

pawn Код:
public OnPlayerConnect(playerid)
{
    masklabel[playerid] = Create3DTextLabel(" ", GREY, -1.0, -1.0, -1.0, -1.0, 0);
    Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
    return 1;
}
Here is OnPlayerUpdate:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(MaskOn[playerid] == 1)
    {
        new string[256];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, false);
        }
        format(string, sizeof(string), "Stranger_%d", MaskNumber[playerid]);
        Update3DTextLabelText(masklabel[playerid], GREY, string);
        Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
    }
    return 1;
}
Here is the /unmask command:

pawn Код:
command(unmask, playerid, params[])
{
    if(Player[playerid][Mask] == 1)
    {
        if(MaskOn[playerid] == 1)
        {
            new string[256];
            MaskOn[playerid] = 0;
            format(string, sizeof(string), "* %s takes off their mask. *", MaskOnOff(playerid));
            CloseMessage(playerid, ACTION, string);
            MaskNumber[playerid] = -1;
            Update3DTextLabelText(masklabel[playerid], GREY, string);
            for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
        }
        else return SendClientMessage(playerid, WHITE, "You don't have your mask on.");
    }
    else return SendClientMessage(playerid, WHITE, "You don't have a Mask.");
    return 1;
}
The problem is, once again; That the players 3d label doesn't appear on the player's head.

Thanks!
Reply
#2

Bump.
Reply
#3

Only others can see the labels attached to you. So you can't see the label attached on another player?
Reply
#4

I can't see it, nope.
Reply
#5

How did you create them?

masklabel[playerid] = Text3D:Create3DTextLabel(....) is how you do it.
Reply
#6

Yes.
Reply
#7

Bumpeeeeeeeeeeeeeeeedy bump. :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)