11.03.2012, 19:32
YJIET, thank you, but is it going to work?
For metres:
For kilometres:
For metres:
pawn Код:
new Float: Distance = floatsqroot((SFPD_X - LSPD_X) * (SFPD_X - LSPD_X) + (SFPD_Y - LSPD_Y) * (SFPD_Y - LSPD_Y) + (SFPD_Z - LSPD_Z) * (SFPD_Z - LSPD_Z)),
Float: Metres = 3.28083989501312,
Float: Result
;
Result = floatdiv(Distance / Metres);
printf("Distance from LSPD to LSPD (in metres): %d", Result);
pawn Код:
new Float: Distance = floatsqroot((SFPD_X - LSPD_X) * (SFPD_X - LSPD_X) + (SFPD_Y - LSPD_Y) * (SFPD_Y - LSPD_Y) + (SFPD_Z - LSPD_Z) * (SFPD_Z - LSPD_Z)),
Float: Metres = 3.28083989501312,
Float: Kilometres,
Float: Result
;
Result = floatdiv(Distance, Metres);
Kilometres = floatdiv(Result, 1000);
printf("Distance from SFPD to LSPD (in kilometres): %d", Kilometres);