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



Attach3DTextLabelToPlayer bug? - iggy1 - 02.01.2011

Well i have some code i wasn't sure whether post in the bugs section, or here. I decided here because i might be doing something wrong. Anyway, i want to attach 3d text to a player and its not working at all. I was originally using incognito's streamer and using the "attachedplayer" parameter but that didn't work.

The problem is whenever i attach 3dtext to a player - it destroys the 3dtext . I'm quite sure im doing everything right but maybe not.....

Heres the code,
pawn Код:
new Text3D:ij_viptitles[MAX_PLAYERS];//global
new ij_hastitle[MAX_PLAYERS];// "   "

COMMAND:viptitle(playerid, params[])
{
    if(ij_vipdata[playerid][ij_viplogged])
    {
        if(isnull(params))return SendClientMessage(playerid,LRED,"ERROR: Usage /viptitle [title/name]");
        else if(strlen(params) > 25)return SendClientMessage(playerid,LRED,"ERROR: That title is too long max length is 25");
        else
        {
            SendClientMessage(playerid, GREEN, "Use /titleoff to remove your title");
            if(ij_hastitle[playerid] == 1)
                return Update3DTextLabelText(ij_viptitles[playerid], ORANGE, params);
            else
            {
                new
                    Float:x,
                    Float:y,
                    Float:z;
                GetPlayerPos(playerid, x, y, z);
                ij_viptitles[playerid] = Create3DTextLabel(params,ORANGE, x, y, z, 50.0, GetPlayerVirtualWorld(playerid), 0);
                Attach3DTextLabelToPlayer(ij_viptitles[playerid], playerid, 0.0, 0.0, 0.5);//if i comment this line the 3d text is created
                ij_hastitle[playerid] = 1;                                                 //at the players location.
                return 1;
            }
        }
    }
    else SendClientMessage(playerid,LRED,"You Don't Have Permission To Use That Command");
    return 1;
}
Like the comment says if i delete that line, the text shows on the players position (static).
If i don't delete it nothing shows at all.
Thanks in advance.


Re: Attach3DTextLabelToPlayer bug? - iggy1 - 05.01.2011

Thought i'd bump this... I'll post in bugs section next time if no reply.