SA-MP Forums Archive
Can't find tag mismatch - 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: Can't find tag mismatch (/showthread.php?tid=415462)



Can't find tag mismatch - Daslee - 13.02.2013

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?


Re: Can't find tag mismatch - arakuta - 13.02.2013

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



Re: Can't find tag mismatch - Daslee - 13.02.2013

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


Re: Can't find tag mismatch - CreativityLacker - 13.02.2013

It should be
pawn Code:
new Text3D:tmp;



Re: Can't find tag mismatch - Daslee - 13.02.2013

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;



Re: Can't find tag mismatch - Mmartin - 13.02.2013

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.


Re: Can't find tag mismatch - Daslee - 17.02.2013

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];
?