16.04.2010, 19:41
I've got this code:
But the console shows:
- the if condition is not performed...
Code:
new Float:pos[3], Float:Distance, Float:MaxDistance = 99999.0, LowestID = -1;
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
...
for(new i; i < sizeof(Pos247); i++)
{
Distance = PointToPoint3D(pos[0], pos[1], pos[2], Pos247[i][0], Pos247[i][1], Pos247[i][2]);
printf("%f %f", Distance, MaxDistance);
if(Distance < MaxDistance)
{
Distance = MaxDistance;
LowestID = i;
}
}
Code:
[21:29:06] 2848.760009 99999.000000 [21:29:06] 2056.619873 99999.000000 [21:29:06] 1066.780151 99999.000000 [21:29:06] 1646.422973 99999.000000 [21:29:06] 2312.666259 99999.000000 [21:29:06] 5244.834960 99999.000000 [21:29:06] 2857.414306 99999.000000 [21:29:06] 1411.058227 99999.000000 [21:29:06] 1122.167846 99999.000000 [21:29:06] 1003.160583 99999.000000 [21:29:06] 1235.255126 99999.000000 [21:29:06] 1331.628173 99999.000000 [21:29:06] 2219.748046 99999.000000

