SA-MP Forums Archive
What have i done wrong? - 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: What have i done wrong? (/showthread.php?tid=196834)



What have i done wrong? - MW2_OWN3D - 07.12.2010

I guess coding 1300 lines in under 8 hours has had a bad outcome.

Quote:

C:\Users\MW2_OWN3D\Desktop\Ultimate Freeroam 0.3C\gamemodes\own3d_roleplay.pwn(1250) : warning 213: tag mismatch

Код:
stock GetDistanceBetweenPoints(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2)
{
  new Float:distance[3];
  distance[0] = x - x2;
  distance[0] *= distance[0];
  distance[1] = y - y2;
  distance[1] *= distance[1];
  distance[2] = z - z2;
  distance[2] *= distance[2];
  distance[0] += distance[1] + distance[2];
  return floatsqroot(distance[0]); //Tag Mismatch HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
UPDATE: FIXED!

Fix:
Код:
forward Float:GetDistanceBetweenPoints(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2);
public Float:GetDistanceBetweenPoints(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2)
{
  new Float:distance[3];
  distance[0] = x - x2;
  distance[0] *= distance[0];
  distance[1] = y - y2;
  distance[1] *= distance[1];
  distance[2] = z - z2;
  distance[2] *= distance[2];
  distance[0] += distance[1] + distance[2];
  return floatsqroot(distance[0]);
}



Re: What have i done wrong? - XePloiT - 07.12.2010

weird... i tried to compile and it shows no errors :\


Re: What have i done wrong? - MW2_OWN3D - 07.12.2010

yes thats what I don't understand.


Re: What have i done wrong? - XePloiT - 07.12.2010

you just forgot the forward? lol... don't worry, this is happens to the best !


Re: What have i done wrong? - __ - 07.12.2010

pawn Код:
stock Float:GetDistanceBetweenPoints(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2)
{
  new Float:distance[3];
  distance[0] = x - x2;
  distance[0] *= distance[0];
  distance[1] = y - y2;
  distance[1] *= distance[1];
  distance[2] = z - z2;
  distance[2] *= distance[2];
  distance[0] += distance[1] + distance[2];
  return floatsqroot(distance[0]);
}
The code above would have worked equally as well and you would have been able to retain the stock initializer.