xyz = {
{1,1,2},
{-15,0,5},
{17,35,9},
{79,96,35}
} -- таблицы с позиц
local min = math.huge
pos = {getCharCoordinates(PLAYER_PED)} -- позиция игрока
function minim(arg)
for l,k in pairs(arg) do
cord = math.sqrt((pos[1]-k[1])^2+(pos[2]-k[2])^2+(pos[3]-k[3])^2)
print(l,cord)
min = math.min(min,cord)
end
return min
end
print(minim(xyz))