SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/01/2019, 07:33 PM   #1
Baboon
Banned
 
Join Date: Nov 2010
Location: The Netherlands
Posts: 918
Reputation: 348
Default Tag mismatch returning arrays

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?
Baboon is offline   Reply With Quote
Old 02/01/2019, 07:37 PM   #2
Kar
Banned
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,938
Reputation: 538
Default Re: Tag mismatch returning arrays

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);
?
Kar is offline   Reply With Quote
Old 02/01/2019, 07:47 PM   #3
Baboon
Banned
 
Join Date: Nov 2010
Location: The Netherlands
Posts: 918
Reputation: 348
Default Re: Tag mismatch returning arrays

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
Baboon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning a CMD! Compiler Scripting Help 4 28/02/2016 08:46 AM
Returning your name ConnorP Scripting Help 9 22/05/2013 08:10 PM
Returning to ID 0 sodeo Scripting Help 6 17/10/2011 10:14 PM
Tag mismatch with arrays and enums 4512jth Help Archive 2 23/06/2011 10:20 AM
Returning arrays niCe Help Archive 3 28/11/2009 12:45 AM


All times are GMT. The time now is 01:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.