Function
#3

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.
Reply


Messages In This Thread
Function - by BaubaS - 11.03.2012, 18:52
Re: Function - by coole210 - 11.03.2012, 18:59
Re: Function - by Stylock - 11.03.2012, 19:08
Re: Function - by BaubaS - 11.03.2012, 19:32
Re: Function - by Stylock - 11.03.2012, 19:44
Re: Function - by BaubaS - 11.03.2012, 19:57
Re: Function - by Vince - 11.03.2012, 20:05
Re: Function - by Stylock - 11.03.2012, 20:28

Forum Jump:


Users browsing this thread: 1 Guest(s)