Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
When you put a tag on a function (Float: in this case) the definition of the function must come before the function is called, IE put it at the very top or in an include.
I don't exactly know why this happens, I'm sure someone who knows the compiler can tell you why but, for now the above will fix the warning.
Posts: 1,226
Threads: 217
Joined: Jan 2012
Reputation:
0
Just it's strange why it's happening.. Now I puted on top ofthe script.. lets see if it will work just it's in yom buttons.. I don't want to mess include up!
Posts: 371
Threads: 8
Joined: Aug 2012
i'm not sure but try this
pawn Code:
Float:Angle2D(Float:PointA[], Float:PointB[])
{
new bool:A_LS_B[2], Float:Dist[2], Float:Angle;
for (new i = 0; i < 2; i++)
{
A_LS_B[i] = PointA[i] < PointB[i];
Dist[i] = A_LS_B[i] ? PointB[i] - PointA[i] : PointA[i] - PointB[i];
}
Angle = atan2(Dist[1],Dist[0]);
if(Angle = A_LS_B[0]) ? 270.0 + Angle : 90.0 - Angle;
if(Angle = A_LS_B[1]) ? Angle : 180.0 - Angle;
return Angle;
}