Quote:
Originally Posted by coole210
pawn Код:
//Distances: new Float:Distances[3]; Distances[0] = floatsub(X1,X2);//LSPDX,SFPDX - X Offset Distance Distances[1] = floatsub(Y1,Y2);//LSPDY,SFPDY - Y Offset Distance Distances[2] = floatsub(Z1,Z2);//LSPDZ,SFPDZ - Z Offset Distance
Guessed, but in theory it should work
|
Utter fail. This is the correct way:
Код:
floatsqroot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2));
That calculates distance in game units (I assume it's feet).To convert that to meters, divide it by 3.28083989501312.