lua GetDistance might be broken
Posted: Tue Feb 16, 2010 7:00 am
GetDistance (longitude1, latitude1, longitude2, latitude2)
Returns the ingame distance between the two given points (longitude1, latitude1) and (longitude2, latitude2).
Returns 8.5. Should return 0.
I wrote a new function for this, use freely if desired:
Returns the ingame distance between the two given points (longitude1, latitude1) and (longitude2, latitude2).
Code: Select all
x1 = 12.5
y1 = 4
x2 = 12.5
y2 = 4
SendChat(GetDistance(x1, y1, x2, y2 ))
Returns 8.5. Should return 0.
I wrote a new function for this, use freely if desired:
Code: Select all
function GetRealDistance(x1,y1,x2,y2)
dist = math.sqrt((x2-x1)^2 + (y2-y1)^2)
return dist
end