SA-MP Forums Archive
Updating a 3DTextLabel - 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)
+--- Thread: Updating a 3DTextLabel (/showthread.php?tid=413913)



Updating a 3DTextLabel - CrossOv3r - 07.02.2013

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!


Re: Updating a 3DTextLabel - B-Matt - 07.02.2013

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").


Respuesta: Updating a 3DTextLabel - CrossOv3r - 07.02.2013

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


Re: Updating a 3DTextLabel - B-Matt - 07.02.2013

Is text variable the global variable?


Respuesta: Updating a 3DTextLabel - CrossOv3r - 07.02.2013

Yes, is a global variable


Respuesta: Updating a 3DTextLabel - CrossOv3r - 07.02.2013

Bump!


Respuesta: Updating a 3DTextLabel - CrossOv3r - 07.02.2013

Another bump! :c


Re: Updating a 3DTextLabel - Scenario - 07.02.2013

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;
}