-- ═══════════════════════════════════════════════════ -- MonetMarket · автоустановщик -- Скрипт: Visual Skins (v2.0) -- Автор: victor_strand -- Файл сам скачает скрипт и удалится после установки. -- ═══════════════════════════════════════════════════ script_name('MonetMarket Installer: Visual Skins') script_author('MonetMarket') script_version('1.0') local URL = 'https://monetmarketsamp.com/d/visual-skins' local FILENAME = 'SkinChanger.lua' local TITLE = 'Visual Skins' local SHA = 'd703f8562850c19b44397042d09915907b89ba2cd4d14fb41dc57b65c00fa5a0' local function say(msg) if sampAddChatMessage then sampAddChatMessage('{7c5cff}[MonetMarket]{ffffff} ' .. msg, -1) else print('[MonetMarket] ' .. msg) end end local function writeFile(path, data) local f = io.open(path, 'wb') if not f then return false end f:write(data); f:close() return true end -- Загрузка через requests (MonetLoader) либо downloadUrlToFile (MoonLoader) local function download(target) local okReq, requests = pcall(require, 'requests') if okReq and requests then local ok, resp = pcall(requests.get, URL) if ok and resp and resp.status_code == 200 and resp.content then return writeFile(target, resp.content) end return false, (resp and resp.status_code) or 'нет ответа' end if downloadUrlToFile then local done, fail = false, false downloadUrlToFile(URL, target, function(id, status) if status == 6 then done = true end -- STATUSEX_ENDDOWNLOAD if status == 4 or status == 5 then fail = true end end) local waited = 0 while not done and not fail and waited < 60000 do wait(100); waited = waited + 100 end return done end return false, 'нет доступного HTTP-модуля' end function main() if isSampAvailable then while not isSampAvailable() do wait(200) end end wait(1500) local dir = getWorkingDirectory() local target = dir .. '/' .. FILENAME say('Устанавливаю «' .. TITLE .. '»…') local ok, err = download(target) if not ok then say('{ff5566}Не удалось скачать: ' .. tostring(err or 'ошибка сети')) say('Скачайте вручную: ' .. URL) return end say('{44dd88}Готово!{ffffff} Файл: ' .. FILENAME) say('Перезагружаю скрипты…') -- самоудаление установщика local me = thisScript and thisScript() local myPath = me and (me.path or (dir .. '/' .. (me.filename or ''))) wait(500) if myPath then pcall(os.remove, myPath) end wait(500) if reloadScripts then reloadScripts() end end