Tag missmatch
#1

Hi.. I'm getting a tag missmatch warning for this line:
pawn Код:
return Distance[3];
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)
Reply
#2

Show the declaration of Distance[]. I assume it is a float, therefore requires a 'Float:' tag.
Reply
#3

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 )
Reply
#4

pawn Код:
stock GetDistance(...)
{
  ...
  return _Distance[3];
}
Reply
#5

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...
Reply
#6

pawn Код:
stock GetDistance(...)
{
  ...
  return _:Distance[3];
}
my bad...try now
Reply
#7

that one's better Thank you very much
Reply
#8

Function tag and return value tag should be same.

pawn Код:
stock Float:GetDistance(...)
Reply
#9

obviously.. totally forgot about that....
Reply
#10

https://sampwiki.blast.hk/wiki/Stocks

You can use the 2 ways.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)