function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
if active and text:find('%d+%s %d') then
homes[#homes + 1] = text
--sampAddChatMessage(text,0xffffff)
getjson(homes)
return{id,color,position,distance,testLOS,attachedPlayerId,attachedVehicleId,text}
end
end
function getjson(arg)
local fpath = getWorkingDirectory()..'moonloader\\config\\houses.json' -- какой файлик открыть
if not doesFileExist(fpath) then
local newfile = io.open(fpath, 'w') -- если его нету то он записывается
newfile:write(arg)
newfile:close()
end
local f = io.open(fpath, 'r') -- открывает файл
if f then
local info = decodeJson(f:read('*a')) -- читает
--sampAddChatMessage(, 0xFFFFFF)
end
end