SA-MP Forums Archive
Tag mismatch [SOLVED] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tag mismatch [SOLVED] (/showthread.php?tid=121425)



Tag mismatch [SOLVED] - Dark_Kostas - 16.01.2010

pawn Код:
stock PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
{
  new Float:px,Float:py,Float:pz;
  GetPlayerPos(playerid,px,py,pz);
  return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );//<---------
}
Why do i get tag mismatch error at this line?


Re: Tag mismatch - Backwardsman97 - 16.01.2010

You can't return a float.


Re: Tag mismatch - GTAguillaume - 16.01.2010

Quote:
Originally Posted by Backwardsman97
You can't return a float.
Not true
Код:
Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
{
  new Float:px,Float:py,Float:pz;
  GetPlayerPos(playerid,px,py,pz);
  return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );//<---------
}



Re: Tag mismatch - Dark_Kostas - 17.01.2010

It didnt work. But you gave me the idea to try it with Public.
pawn Код:
forward Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z);
public Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
{
  new Float:px,Float:py,Float:pz;
  GetPlayerPos(playerid,px,py,pz);
    return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );
}
This is working. Problem SOLVED.