Quote:
Originally Posted by Cuecumber
My mistake, it was Angle2D()
pawn Код:
Float:Angle2D (Float:PointA [], Float:PointB []) // Credits to 0rb - http://forum.sa-mp.com/index.php?topic=6...#msg582490]http://forum.sa-mp.com/index.php?topic=61574.msg582490#msg582490{ new Float:Dist [2], Float:Angle ; Dist [0] = PointA [0] < PointB [0] ? PointB [0] - PointA [0] : PointA [0] - PointB [0]; Dist [1] = PointA [1] < PointB [1] ? PointB [1] - PointA [1] : PointA [1] - PointB [1]; Angle = atan2(Dist [1], Dist [0]); Angle = PointA [0] < PointB [0] ? 270.0 + Angle : 90.0 - Angle; Angle = PointA [1] < PointB [1] ? Angle : 180.0 - Angle; return Angle < 0.0 ? Angle + 360.0 : Angle; }
That should do the job perfectly
EDIT: Ergh, it appears to have added in the url tags for me, when I didn't want it to, perhaps that's a new function of the forum formatting.
~Cueball~
|
well...
now i am busy with it but i am stuck with a problem...
in Angle2D() are 2 parameters 1 is point A and 2 is Point B but i am using coordinates so i need one with XYZ