Create3DTextLabel ??
#3

Hi.

At TOP of your script you have to declare the 3DTextVariable, let's call it, DialogLabel. And because you want to create more then one, we delare the number you want to have as well. Let's put it to 100, but you can change it.
pawn Код:
#define MAX_LABELS_I_USE_AT_MY_DIALOG 100
new Text3D:DialogLabels[MAX_LABELS_I_USE_AT_MY_DIALOG];
We also need a vraible to store if the ID was already used:
pawn Код:
new Used3DTextAtDialog[MAX_LABELS_I_USE_AT_MY_DIALOG];
Now at the OnDialogResponse:
pawn Код:
new textString3D[98], ID=-1;
format(textString3D,sizeof(textString3D),"%s",inputtext);
for(new i=0; i<MAX_LABELS_I_USE_AT_MY_DIALOG; i++) if(Used3DTextAtDialog[i]==0) ID=i, break;
if(ID==-1) return SendClientMessage(playerid, COLOR_RED, "ERROR: All Dialog-3DTexts are used!"); //If this comes, change 'MAX_LABELS_I_USE_AT_MY_DIALOG' to a higher value.
DialogLabels[ID] = Create3DTextLabel(textString3D,COLOR_WHITE,X,Y,Z,50.0,0,0);
Used3DTextAtDialog[ID]=1; //This will let the server know, that this dialog-3dtext is now in use.
And this is where you remove it (Here we need the ID from upon):
pawn Код:
Remove = strval(inputtext);
Delete3DTextLabel(DialogLabels[Remove]);
Used3DTextAtDialog[Remove]=0;  //This will let the server know, that this dialog-3dtext is not used anymore.
I hope this helps you.

If you have any questions, feel free to ask.


Jeffry
Reply


Messages In This Thread
Create3DTextLabel ?? - by park4bmx - 23.02.2011, 15:46
Re: Create3DTextLabel ?? - by BMUK - 23.02.2011, 16:12
Re: Create3DTextLabel ?? - by Jeffry - 23.02.2011, 16:16
Re: Create3DTextLabel ?? - by park4bmx - 23.02.2011, 16:17
Re: Create3DTextLabel ?? - by Jeffry - 23.02.2011, 16:19
Re: Create3DTextLabel ?? - by park4bmx - 23.02.2011, 16:31
Re: Create3DTextLabel ?? - by Jeffry - 23.02.2011, 17:14

Forum Jump:


Users browsing this thread: 1 Guest(s)