20.02.2009, 18:18
Use the one i wrote long time ago..
pawn Код:
Float:Angle2D(Float:PointA[], Float:PointB[])
{
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;
}