SA-MP Forums Archive
Tag mismatch returning arrays - 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: Tag mismatch returning arrays (/showthread.php?tid=662479)



Tag mismatch returning arrays - Baboon - 02.01.2019

Hi everyone

Trying to do a crossproduct with 2 vectors:

Code:
crossproduct(Float:x[], Float:y[]) //vectors 3x1
{
    new Float:h[3];
	h[0] = x[1] * y[2] - x[2] * y[1];
	h[1] = -(x[0] * y[2] - x[2] * y[0]);
	h[2] = x[0] * y[1] - y[0] * x[1];
    return _:h;
}
Under OnGameModeInit
Code:
new
	Float:x[3] = { 1.0, 2.0, 3.0 },
	Float:y[3] = { 4.0, 5.0, 6.0 },
	Float:h[3];

	h = crossproduct(x, y);
	printf("test: %f, %f, %f", h[0], h[1], h[2]);
It prints properly, however my compiler gives the following warning:
warning 213: tag mismatch for the line: h = crossproduct(x, y);

Any help?


Re: Tag mismatch returning arrays - Kar - 02.01.2019

Code:
crossproduct(Float:x[], Float:y[]) //vectors 3x1
{
    new Float:h[3];
    return _:h;
}
you removed the tag lol

then
Code:
Float:h[3];

	h = crossproduct(x, y);
?


Re: Tag mismatch returning arrays - Baboon - 02.01.2019

Quote:
Originally Posted by Kar
View Post
Code:
crossproduct(Float:x[], Float:y[]) //vectors 3x1
{
    new Float:h[3];
    return _:h;
}
you removed the tag lol

then
Code:
Float:h[3];

	h = crossproduct(x, y);
?
I think I'm going nuts? It's been a while, however I just don't see where I removed the tag? I defined the variable and just try to save the output of the function in variable 'h' under OnGameModeInit.

edit: nvm gotchu thanks!
fixed