Posts: 143
Threads: 40
Joined: Aug 2014
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_GREEN, 30.0, 40.0, 50.0, 40.0, 0, 0);
Any chance we can do it? because i tried and it gave me tag mismatch
Posts: 1,266
Threads: 6
Joined: Oct 2014
Your code is perfect I'm sure the problem is on
Try changing it to -1 and see result
Posts: 100
Threads: 2
Joined: May 2016
Yes, it's possible. See this thread (
https://sampforum.blast.hk/showthread.php?tid=606806) for an example.
Posts: 143
Threads: 40
Joined: Aug 2014
tried. My real code that im trying to use is:
PHP код:
new statusstring[250]
format(statusstring, sizeof(statusstring), "Info Planta: \nEm crescimento.\n ID %d", drogasid);
drogastatus[drogasid] = CreatePlayer3DTextLabel(playerid,statusstring,-1,sementeposX[drogasid],sementeposY[drogasid],sementeposZ[drogasid],10.0,0);
Posts: 100
Threads: 2
Joined: May 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.
Posts: 143
Threads: 40
Joined: Aug 2014
new Text3d:drogastatus[200];
the 200 is for the object id's
Posts: 100
Threads: 2
Joined: May 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);
Posts: 143
Threads: 40
Joined: Aug 2014
so should i replace drogasid for the enumerator?
Posts: 100
Threads: 2
Joined: May 2016
pawn Код:
[id/slot/index][enumerator elements]
So, no. You now have two set of brackets.