function sampEvents.onShowDialog(id, style, title, button1, button2, text)
if title:find('Важные места') then
local prepText = string.gsub(text, '{......}', '')
prepText = splitStringByLine(prepText)
for key, value in pairs(prepText) do
local distance = value:match('(%d+%.%d+) м%.')
if distance ~= nil then
-- ...
end
end
end
end
function splitStringByLine(string)
local splitText = {}
for line in string:gmatch("([^\n]*)\n?") do
if line ~= "" or #splitText == 0 or string:sub(-1) == "\n" then
table.insert(splitText, line)
end
end
return splitText
end