Attach3DTextLabelToPlayer bug.
#1

I posted this in scripting discussion incase i did something wrong. I bumped the topic and got no reply.
Anyway i want to attach 3dtext to a player but whenever i use "Attach3DTextLabelToPlayer" the text disappears. Maybe someone can shed some light for me here. Is this a bug? Or a silly mistake by me?? I have the following 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. (static)
                return 1;
            }
        }
    }
    else SendClientMessage(playerid,LRED,"You Don't Have Permission To Use That Command");
    return 1;
}
AFAIK theres nothing wrong with that code.
Reply
#2

Have to ask, are you testing this code on yourself?

We use the 3DText, but they're attached to vehicles. Have you tried getting in a vehicle to see if it will attach to a vehicle without conflicts?
Reply
#3

Well iv tested it on myself ofc, but originally i actually put the code on the server i script for w/o testing because i thought that it should work without the need for testing (because its very simple). I had all the vips report that the command wasn't working. And so i tested on myself (using both incognitos plugin fuctions and the code i posted here) to no avail.

About attaching it to vehicles, that would be a seperate issue realy. I can't see how that would help my situation, but thanks for the suggestion. I'll give it a try.
Reply
#4

Just to make it clear, you put this label on you, and somebody else (who was in same virtual world as you) didn't see the label on you?
Reply
#5

Nope i could not see it and nobody else could. If i create the label at my position it shows (static). When i attach it, it is destroyed. If someone has a command they have tested (ingame not errors) and it works please send it to me so i can see it.
Reply
#6

Well anyway, I hope you do know that players can't see the labels attached to themselves, only others can
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Well anyway, I hope you do know that players can't see the labels attached to themselves, only others can
Seriously?? I wish someone told me that 4 months ago lol. Thanks.

Reply
#8

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Seriously?? I wish someone told me that 4 months ago lol. Thanks.

Better late than never
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)