SA-MP Forums Archive
Text label formatting help. - 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: Text label formatting help. (/showthread.php?tid=606929)



Text label formatting help. - GunZsmd - 11.05.2016

Hi guys,
I would like to know if it is possible to format something and choose it as a 3dtextlabel text. Example:

PHP код:
new string[50];
format(string,sizeof(string), "you're id %d"playerid);
Create3DTextLabel(string,COLOR_GREEN30.040.050.040.000); 
Any chance we can do it? because i tried and it gave me tag mismatch


Re: Text label formatting help. - jlalt - 11.05.2016

Your code is perfect I'm sure the problem is on
PHP код:
COLOR_GREEN 
Try changing it to -1 and see result


Re: Text label formatting help. - KevinReinke - 11.05.2016

Yes, it's possible. See this thread (https://sampforum.blast.hk/showthread.php?tid=606806) for an example.


Re: Text label formatting help. - GunZsmd - 11.05.2016

tried. My real code that im trying to use is:

PHP код:
new statusstring[250]
format(statusstringsizeof(statusstring), "Info Planta: \nEm crescimento.\n ID %d"drogasid);
                                
drogastatus[drogasid] = CreatePlayer3DTextLabel(playerid,statusstring,-1,sementeposX[drogasid],sementeposY[drogasid],sementeposZ[drogasid],10.0,0); 



Re: Text label formatting help. - KevinReinke - 11.05.2016

You have to put "Text3D:" in front of the declaration of the variable.

pawn Код:
new Text3D:drogastatus[what_you_have_here];
See https://sampwiki.blast.hk/wiki/Create3DTextLabel & https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer. The declaration using "Text3D:" is in the 2nd link.


Re: Text label formatting help. - GunZsmd - 11.05.2016

new Text3d:drogastatus[200];
the 200 is for the object id's


Re: Text label formatting help. - KevinReinke - 11.05.2016

Quote:
Originally Posted by GunZsmd
Посмотреть сообщение
new Text3d:drogastatus[200];
the 200 is for the object id's
As first point, capitalize the "d" -> "Text3D:".

Secondly, use an enumerator. Example:
pawn Код:
enum e_variable
{
    object,
    Text3D:label
};

new variable[200][e_variable];
pawn Код:
drogastatus[drogasid][label] = CreatePlayer3DTextLabel(playerid,statusstring,-1,sementeposX[drogasid],sementeposY[drogasid],sementeposZ[drogasid],10.0,0);



Re: Text label formatting help. - GunZsmd - 11.05.2016

so should i replace drogasid for the enumerator?


Re: Text label formatting help. - KevinReinke - 11.05.2016

pawn Код:
[id/slot/index][enumerator elements]
So, no. You now have two set of brackets.