Tag missmatch - 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 missmatch (
/showthread.php?tid=296751)
Tag missmatch -
Sascha - 12.11.2011
Hi.. I'm getting a tag missmatch warning for this line:
Distance[3] is a Float variable shadowing a distance between 2 points (I guess I don't need to post the whole code)..
defined as: new Float : Distance[4];
It is something similar to this:
pawn Код:
stock GetDistance(...)
{
...
return Distance[3];
}
(... = some other code)
Re: Tag missmatch -
MP2 - 12.11.2011
Show the declaration of Distance[]. I assume it is a float, therefore requires a 'Float:' tag.
Re: Tag missmatch -
Sascha - 12.11.2011
just edited my post with that while you posted it
(left the spaces between the : and the Float and Distance because otherwise it's a
![Cheesy](images/smilies/biggrin.png)
)
Re: Tag missmatch -
Pharrel - 12.11.2011
pawn Код:
stock GetDistance(...)
{
...
return _Distance[3];
}
Re: Tag missmatch -
Sascha - 12.11.2011
Quote:
Originally Posted by Pharrel
pawn Код:
stock GetDistance(...) { ... return _Distance[3]; }
|
that returns
Код:
error 017: undefined symbol "_Distance"
and some other errors in connection with it...
Re: Tag missmatch -
Pharrel - 12.11.2011
pawn Код:
stock GetDistance(...)
{
...
return _:Distance[3];
}
my bad...try now
Re: Tag missmatch -
Sascha - 12.11.2011
that one's better
![Smiley](images/smilies/smile.png)
Thank you very much
Re: Tag missmatch -
MadeMan - 12.11.2011
Function tag and return value tag should be same.
pawn Код:
stock Float:GetDistance(...)
Re: Tag missmatch -
Sascha - 12.11.2011
obviously.. totally forgot about that....
Re: Tag missmatch -
Pharrel - 12.11.2011
https://sampwiki.blast.hk/wiki/Stocks
You can use the 2 ways.