Tag mismatch returning arrays
#1

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?
Reply
#2

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);
?
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)