Updating a 3DTextLabel
#1

Hi!
I have trouble updating a 3DTextLabel, i use a variable like this to create:

pawn Код:
new Text3D:Label
Label = Create3DTextLabel(....
So then i use a CMD to change the label
pawn Код:
cmd(text, playerid, params[])
    {
        new text[128];
        new string[128];
        if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GRAD2, "Use: /text + thetext");
        format(string, sizeof(string), "%s", text);
        Update3DTextLabelText(Label, 0xFFFFFFFF, string);
        return 1;
    }
The Problem?
That creates another "3DTextLabel" NOT update the actual "Label"

Any solution. Thanks to all!
Reply
#2

pawn Код:
cmd(text, playerid, params[])
    {
        new text[128];
        new string[128];
        if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GRAD2, "Use: /text + thetext");
        Update3DTextLabelText(Label, 0xFFFFFFFF, text);
        return 1;
    }
Try this. But I don't understand why you need "thetext" in your CMD ("Use: /text + thetext").
Reply
#3

Hmm... thanks for helping, But its the same result

About: 'CMD ("Use: /text + thetext")'

Because is a CMD to change the 3DText to an personalizate string, text, etc
Reply
#4

Is text variable the global variable?
Reply
#5

Yes, is a global variable
Reply
#6

Bump!
Reply
#7

Another bump! :c
Reply
#8

Assuming that you have added this to the top of your script:

pawn Код:
new Text3D:Label;
... and did this to your Create3DTextLabel() line...

pawn Код:
Label = Create3DTextLabel(...);
... the code below should work fine:

pawn Код:
CMD:text(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, 0xFFFFFFFF, "SYNTAX: /text [message]");
   
    Update3DTextLabelText(Label, 0xFFFFFFFF, params);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)