Can't find tag mismatch
#1

Hello. So I created new stock called Create3DTextLabelA, it's exactly same as Create3DTextLabel, just my stock saves label position in array. And I got tag mismatch warning, but can't find where it is. Here is my code:

Code:
new Float:Labels3D[2000][3];

stock Create3DTextLabelA(text[], color, Float:x, Float:y, Float:z, Float:drawdistance, virtualworld, visiblewalls)
{
	new tmp;
	tmp = Create3DTextLabel(text,color,Float:x,Float:y,Float:z,Float:drawdistance,virtualworld,visiblewalls);
	Labels3D[tmp][0]=x; Labels3D[tmp][1]=y; Labels3D[tmp][2]=z;
	return tmp;
}
Compiler saying, that tag mismatch is on line:
Code:
tmp = Create3DTextLabel(text,color,Float:x,Float:y,Float:z,Float:drawdistance,virtualworld,visiblewalls);
But which one is wrong?
Reply
#2

You must use "Float:" only in a variable declaration.

If you wanna get or set the value, you should use only the variable name.

pawn Code:
tmp = Create3DTextLabel(text,color,x,y,z,drawdistance,virtualworld,visiblewalls);
Reply
#3

Quote:
Originally Posted by arakuta
View Post
You must use "Float:" only in a variable declaration.

If you wanna get or set the value, you should use only the variable name.

pawn Code:
tmp = Create3DTextLabel(text,color,x,y,z,drawdistance,virtualworld,visiblewalls);
But still getting that warning even without "Float:"...
Reply
#4

It should be
pawn Code:
new Text3D:tmp;
Reply
#5

I tried this also, so I got same warning on those lines:
pawn Code:
Labels3D[tmp][0]=x; Labels3D[tmp][1]=y; Labels3D[tmp][2]=z;
return tmp;
Reply
#6

Quote:
Originally Posted by Daslee
View Post
I tried this also, so I got same warning on those lines:
pawn Code:
Labels3D[tmp][0]=x; Labels3D[tmp][1]=y; Labels3D[tmp][2]=z;
return tmp;
That's because the inner variables in the array (such as labels3d[tmp][0]) aren't declared as float variables. Fix that and you will get rid of your warning.
Reply
#7

Quote:
Originally Posted by Mmartin
View Post
That's because the inner variables in the array (such as labels3d[tmp][0]) aren't declared as float variables. Fix that and you will get rid of your warning.
You mean this:
pawn Code:
new Float:Labels3D[2000][3];
To:
pawn Code:
new Float:Labels3D[2000][Float:3];
?
Reply


Forum Jump:


Users browsing this thread: