script_author = "Gorskin" script_name = "[GT]" script_version = "1.5.3" script_properties('work-in-pause') -- Проверка и загрузка необходимых библиотек local function requireLib(name, url) local ok, lib = pcall(require, name) if not ok then print(("Отсутствует библиотека или модуль: '%s'"):format(name)) if url then print(("Скачать: %s"):format(url)) end end return lib end local ffi = require("ffi") local imgui = requireLib("mimgui") local RakLua = requireLib("RakLua") local vkeys = requireLib("vkeys") local tcc = requireLib("libtcc") local lfs = requireLib("lfs") local hotkey = requireLib("mimgui_hotkeys", "https://www.blast.hk/threads/178867/") local memory = requireLib("memory") local encoding = require("encoding") encoding.default = "CP1251" local u8 = encoding.UTF8 local wm = require("windows.message") local fa = requireLib("fAwesome5") --[[ GT MODULES ]] local config = dofile(getWorkingDirectory()..'/GameTweaker\\GT_DATA\\config.lua') local sampapi = requireLib("sampapi", "https://github.com/imring/SAMP-API.lua") if sampapi then SCNetGame = sampapi.require("CNetGame", true) SCPlayerPool = sampapi.require("CPlayerPool", true) end local samem = requireLib("SAMemory", "https://www.blast.hk/threads/20472/") if samem then samem.require("CPed") samem.require("CCamera") samem.require("CCam") samem.require("eCamMode") samem.require("CEntity") end -- [ memory funcs (fix for moonloader v. 0.27)] function memory_getfloat(adr, prot) return representIntAsFloat(readMemory(adr, 4, prot)) end function memory_setfloat(adr, value, prot) return writeMemory(adr, 4, representFloatAsInt(value), prot) end function hex2bin(hexData, address, numBytes) -- Преобразуем hex строку в массив байтов local bytes = {} for i = 1, #hexData, 2 do local byte = tonumber(hexData:sub(i, i + 1), 16) table.insert(bytes, byte) end -- Записываем байты по 4 за раз for i = 1, numBytes, 4 do local chunk = 0 for j = 0, 3 do local index = i + j if index <= numBytes then chunk = chunk + (bytes[index] or 0) * (0x100 ^ j) end end writeMemory(address + i - 1, math.min(4, numBytes - i + 1), chunk, true) end end --============================== [ ImTypes ] ============================== local new, str, sizeof = imgui.new, ffi.string, ffi.sizeof --========================================================================= local weaponSoundDelayPainAndHit = {[9] = 200, [37] = 900, } -- ugenrl local weaponSoundDelayGuns = {[38] = 50,} local soundsDir = "moonloader/GameTweaker/genrl/" -- ugenrl local sizeX, sizeY = getScreenResolution() local UI = { main = new.bool(false), tcyc = new.bool(false), tws = new.bool(false), } ----------------------------------------{Json}----------------------------------------- function formatterJson(data, options) local function pretty(dataStr, spaces) local spaces = spaces ~= nil and string.rep(' ', spaces) or '\t' local result = '' local level = 0 local in_string = false for i = 1, #dataStr do local c = dataStr:sub(i, i) if c == '{' or c == '[' then level = level + 1 result = result .. c .. '\n' .. string.rep(spaces, level) elseif c == '}' or c == ']' then level = level - 1 result = result .. '\n' .. string.rep(spaces, level) .. c elseif c == ',' then result = result .. c if not in_string then result = result .. '\n' .. string.rep(spaces, level) end elseif c == ':' then result = result .. ': ' else result = result .. c if c == '"' then in_string = not in_string end end end return result end local options = options or { } local data = type(data) == 'table' and encodeJson(data) or data local dataStr = pretty(data, options['spaces']) return dataStr end local IEPresets = { Money = { posMoneyX=-32, fontmoneyborder=2, animmoney=2, sizeMoneyY=1.1, EditMoney=true, moneyzerofix=false, fontmoneystyle=3, posdollar=0, sizeMoneyX=0.55, posMoneyY=89, }, Radar = { radaralpha=255, radarblipA=255, radarPosX=40, radarfix=true, minimapzoom=false, minimapzoomvalue=180.0, smalliconsradar=false, roundedRadarSize=1.0, radarWidth=76, radar_color_fix=false, radarPosY=104, radarHeight=94, trianglev_icon_border=1.4, trianglen_icon_size=1.4, player_icon_size=7.0, smalliconsradar=false, quadro_icon_size=1.4, trianglen_icon_border=1.4, quadro_icon_border=1.4, trianglev_icon_size=1.4, osnov_icon=7.5, arrowmap_size=10, radrarnorth=false, Type=0, radardisc=false, }, Health = { nohealthflick=false, healthborder=true, sizeHealthY=9, posHealthY=77, posHealthX=-141, sizeHealthX=109, EditHealth=true, oneHundredAndSixtyHPbar=false, }, Armor = { EditArmor=true, posArmorX=-94, posArmorY=48, sizeArmorX =62, sizeArmorY =9, eternalArmor=false, armorborder=true, }, Wanted = { spaceWanted=18, sizeWantedY=1.21, sizeWantedX=0.6, posWantedX=-29, EditWanted=true, eternalwanted=false, posWantedY=114, emptyStars=false, }, Crosshair = { crosshairSizeX=64.0, crosshairSizeY=64.0, nocrosshaireditsize=false, }, Patrons = { sizePatronsY=0.7, posPatronsY=43, EditPatrons=true, sizePatronsX=0.3, posPatronsX=47, renderammo=false, fontammostyle=1, singleclip = false, EternalPatrons = false, }, MenuPause = { beginmenu=false, fullmenuheight=480, fontmenubasestyle=2, fullmenuwidth=640, fontmenutumblerstyle=2, fontmenuheaderstyle=0, fullmenuimage=false, speedinputsmap=21.00, mapzoomvalue=300, mapzoomfixer=true, fixloadmap=true, mapzoom=true, helptext=false, arrowicon_menu=false, gxtEntryEditor=false, beginText="Меню паузы", useMynameInBeginMenu=false, resume ="Продолжить", start_new_game="Начать новую игру", map="Карта", stats="Статистика", brief="Сводка", settings="Настройки", quitGame="Выйти из игры", }, Breath = { posBreathX=-94, EditBreath=true, sizeBreathY=9, breathborder=true, eternalBreath=false, sizeBreathX=62, posBreathY=62, }, Weapon = { sizeWeaponY=58, posWeaponX=-32, posWeaponY=20, sizeWeaponX=47, EditWeapon=true, }, Clock = { posClockX=-32, fontstyleclock=2, fontoutlineclock=2, sizeClockX=0.55, posClockY=22, DrawClock=false, PcClock=false, DrawSec=false, EditClock=true, sizeClockY=1.1, }, Other = { showhud=false, showchat=false, targetblip=true, }, Recolorer = { Recolorer = false, Health = -6222836, Armor = -1, Stars = -2851328, Patrons = -3543041, PlayerHealth = -65536, PlayerHealth2 = -15461356, PlayerArmor = -1, PlayerArmor2 = -15461356, Money = -16751862, }, HPHud = { Status = false, fonts = 3, hptext = false, posX = 609.70, posY = 66.0, Color = "0xFFFFFFFF", sizeX = 0.250, sizeY = 1.000, }, ArmorHud = { Status = false, fonts = 3, armortext = false, posX = 609.70, posY = 44.30, Color = "0xFFFFFFFF", sizeX = 0.250, sizeY = 1.000, }, } local txtFiles = {} -- Таблица для хранения названий файлов function getJson() if not doesDirectoryExist(getWorkingDirectory().."\\GameTweaker\\IE-presets") then createDirectory(getWorkingDirectory().."\\GameTweaker\\IE-presets") end if doesFileExist(getWorkingDirectory().."\\GameTweaker\\IE-presets\\"..config.ini.settings.currentpreset) then local jsfile = getWorkingDirectory().."\\GameTweaker\\IE-presets\\"..config.ini.settings.currentpreset local file = io.open(jsfile, "r") -- Открываем файл в режиме чтения a = file:read("*a") -- Читаем файл, там у нас таблица file:close() preset = decodeJson(a) -- Читаем нашу JSON-Таблицу local file = io.open(jsfile, "w") file:write(formatterJson(preset)) file:flush() file:close() else local file = io.open(getWorkingDirectory().."\\GameTweaker\\IE-presets\\"..config.ini.settings.currentpreset, "a+") -- открываем и создаем файл file:close() -- закрываем, это если не будет файла то он создатся. Да да это гениально! local file = io.open(getWorkingDirectory().."\\GameTweaker\\IE-presets\\"..config.ini.settings.currentpreset, "w") file:write(formatterJson(IEPresets)) -- Записываем нашу таблицу file:flush() file:close() getJson() end end getJson() function jsonExist(table) for key, value in pairs(table) do for subkey, subvalue in pairs(value) do if preset[key][subkey] == nil then preset[key][subkey] = subvalue end end end end jsonExist(IEPresets) function saveJson(table) if table == "preset" then local file = io.open(getWorkingDirectory().."\\GameTweaker\\IE-presets\\"..config.ini.settings.currentpreset, "w") file:write(formatterJson(preset)) file:flush() file:close() end end local function explode_rgba(argb)-- преобразовать цвет из конфига в виде 0xFF - alpha FFFFFF - white в r,g,b,a для coloredit local a = bit.band(bit.rshift(argb, 24), 0xFF) / 255 local r = bit.band(bit.rshift(argb, 16), 0xFF) / 255 local g = bit.band(bit.rshift(argb, 8), 0xFF) / 255 local b = bit.band(argb, 0xFF) / 255 return r, g, b, a end ----------------------------------------------------------------------------------------------- local tbmtext = { u8"Быстрая", u8"Без анимации", u8"Стандартная", } local tmtext = imgui.new['const char*'][#tbmtext](tbmtext) local gmodetext = { u8"Only Genrl", u8"Game Sounds + Genrl", u8"Game Sounds + Bell + Kill", } local gmodechar = imgui.new['const char*'][#gmodetext](gmodetext) local typebarstext = { u8"Обычный", u8"Обычный + тоньше", u8"Удлиненный", u8"Удлиненный + тоньше", } local typebarschar = imgui.new['const char*'][#typebarstext](typebarstext) local typebarsforma = { u8"Стандартный", u8"Иконки", } local typebarsformachar = imgui.new['const char*'][#typebarsforma](typebarsforma) -- Список флагов шрифта local fontFlagsText = { u8"NONE", u8"BOLD", u8"ITALICS", u8"BORDER", u8"SHADOW", u8"UNDERLINE", u8"STRIKEOUT", } local fontFlagsChar = imgui.new['const char*'][#fontFlagsText](fontFlagsText) local fontmoneybordertext = { u8"Без обводки", u8"Тонкая", u8"Cтандартная", } local fontmoneyborderchar = imgui.new['const char*'][#fontmoneybordertext](fontmoneybordertext) local posdollartext = { u8"Слева", u8"Справа", } local posdollarchar = imgui.new['const char*'][#posdollartext](posdollartext) local fontstyletext = { u8"FONT_GOTHIC", u8"FONT_SUBTITLES", u8"FONT_MENU", u8"FONT_PRICEDOWN", } local fontstylechar = imgui.new['const char*'][#fontstyletext](fontstyletext) local fontoutlineclockchar = imgui.new['const char*'][#fontmoneybordertext](fontmoneybordertext) local radarTypeText = { u8"Стандартный", u8"Круглый", u8"Квадратный", u8"Definitive Edition (В разработке!)", } local radarTypeChar = imgui.new['const char*'][#radarTypeText](radarTypeText) ------------------------------------------------------------------------------------------------ local CNTrenderFont = renderCreateFont(config.ini.custom_nametags.fontName, config.ini.custom_nametags.fontSize, config.ini.custom_nametags.fontFlag) local sliders = {} local checkboxes = {} local buffers = {} local icolors = {} function imgui_Data() -------------------------- [sliders] -------------------------- sliders.weather = new.int(tonumber(config.ini.settings.weather)) sliders.doweather = new.int(tonumber(config.ini.settings.doweather)) sliders.otweather = new.int(tonumber(config.ini.settings.otweather)) sliders.miliseconds = new.int(tonumber(config.ini.settings.miliseconds)) sliders.hours = new.int(tonumber(config.ini.settings.hours)) sliders.min = new.int(tonumber(config.ini.settings.min)) sliders.drawdist = new.float(tonumber(config.ini.settings.drawdist)) sliders.drawdistair = new.float(tonumber(config.ini.settings.drawdistair)) sliders.drawdistpara = new.float(tonumber(config.ini.settings.drawdistpara)) sliders.fog = new.float(tonumber(config.ini.settings.fog)) sliders.lod = new.float(tonumber(config.ini.settings.lod)) sliders.playersDist = new.float(tonumber(config.ini.settings.playersDist)) sliders.drawweapondist = new.float(tonumber(config.ini.settings.drawweapondist)) sliders.allambient = new.float(tonumber(config.ini.fixtimecyc.allambient)) sliders.objambient = new.float(tonumber(config.ini.fixtimecyc.objambient)) sliders.shadowcp = new.int(tonumber(config.ini.settings.shadowcp)) sliders.shadowlight = new.int(tonumber(config.ini.settings.shadowlight)) sliders.aspectratio = new.float(tonumber(config.ini.settings.aspectratio)) sliders.limitmem = new.int(tonumber(config.ini.cleaner.limit)) sliders.MotionBlurIntensity = new.int(tonumber(config.ini.effects_manager.MotionBlurIntensity)) sliders.mapzoomvalue = new.float(tonumber(preset["MenuPause"]["mapzoomvalue"])) sliders.roundedRadarSize = new.float(tonumber(preset["Radar"]["roundedRadarSize"])) sliders.radaralpha = new.float(tonumber(preset["Radar"]["radaralpha"])) sliders.radarblipA = new.float(tonumber(preset["Radar"]["radarblipA"])) sliders.radarw = new.float(tonumber(preset["Radar"]["radarWidth"])) sliders.radarh = new.float(tonumber(preset["Radar"]["radarHeight"])) sliders.radarposx = new.float(tonumber(preset["Radar"]["radarPosX"])) sliders.radarposy = new.float(tonumber(preset["Radar"]["radarPosY"])) sliders.minimapzoomvalue = new.float(tonumber(preset["Radar"]["minimapzoomvalue"])) sliders.brightness = new.int(tonumber(config.ini.settings.brightness)) sliders.hpposX = new.float(tonumber(preset["HPHud"]["posX"])) sliders.hpposY = new.float(tonumber(preset["HPHud"]["posY"])) sliders.hpSizeX = new.float(tonumber(preset["HPHud"]["sizeX"])) sliders.hpSizeY = new.float(tonumber(preset["HPHud"]["sizeY"])) sliders.armorhudPosX = new.float(tonumber(preset["ArmorHud"]["posX"])) sliders.armorhudPosY = new.float(tonumber(preset["ArmorHud"]["posY"])) sliders.armorhudSizeX = new.float(tonumber(preset["ArmorHud"]["sizeX"])) sliders.armorhudSizeY = new.float(tonumber(preset["ArmorHud"]["sizeY"])) sliders.distobjects_stolb_fonars = new.float(tonumber(config.ini.settings.distobjects_stolb_fonars)) sliders.distobjects_musor = new.float(tonumber(config.ini.settings.distobjects_musor)) sliders.nickdistance = new.float(tonumber(config.ini.settings.nickdistance)) sliders.custom_nametags_fontSize = new.int(tonumber(config.ini.custom_nametags.fontSize)) sliders.vehloddist = new.float(tonumber(config.ini.settings.vehloddist)) sliders.speedinputsmap = new.float(tonumber(preset["MenuPause"]["speedinputsmap"])) sliders.osnov_icon = new.float(tonumber(preset["Radar"]["osnov_icon"])) sliders.quadro_icon_size = new.float(tonumber(preset["Radar"]["quadro_icon_size"])) sliders.quadro_icon_border = new.float(tonumber(preset["Radar"]["quadro_icon_border"])) sliders.trianglev_icon_size = new.float(tonumber(preset["Radar"]["trianglev_icon_size"])) sliders.trianglev_icon_border = new.float(tonumber(preset["Radar"]["trianglev_icon_border"])) sliders.trianglen_icon_size = new.float(tonumber(preset["Radar"]["trianglen_icon_size"])) sliders.trianglen_icon_border = new.float(tonumber(preset["Radar"]["trianglen_icon_border"])) sliders.player_icon_size = new.float(tonumber(preset["Radar"]["player_icon_size"])) sliders.arrowmap_size = new.float(tonumber(preset["Radar"]["arrowmap_size"])) ---------------------------------------------------------- sliders.pedfps = new.int(tonumber(config.ini.smart_fps.pedfps)) sliders.vehfps = new.int(tonumber(config.ini.smart_fps.vehfps)) sliders.boatfps = new.int(tonumber(config.ini.smart_fps.boatfps)) sliders.motofps = new.int(tonumber(config.ini.smart_fps.motofps)) sliders.bikefps = new.int(tonumber(config.ini.smart_fps.bikefps)) sliders.swimfps = new.int(tonumber(config.ini.smart_fps.swimfps)) sliders.helifps = new.int(tonumber(config.ini.smart_fps.helifps)) sliders.planefps = new.int(tonumber(config.ini.smart_fps.planefps)) sliders.snipergunfps = new.int(tonumber(config.ini.smart_fps.snipergunfps)) sliders.spraygunfps = new.int(tonumber(config.ini.smart_fps.spraygunfps)) ------------------------------------------------------- sliders.KillListPosX = new.float(config.ini.settings.KillListPosX) sliders.KillListPosY = new.float(config.ini.settings.KillListPosY) sliders.camera = new.float(config.ini.settings.camera) sliders.aiming = new.float(config.ini.settings.aiming) sliders.aimingSniper = new.float(config.ini.settings.aimingSniper) ------------------------- [ugenrl] --------------------------------- sliders.weapon_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.weapon)) sliders.hit_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.hit)) sliders.pain_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.pain)) sliders.kill_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.kill)) sliders.enemyweapon_dist = new.int(tonumber(config.ini.ugenrl_main.enemyWeaponDist)) -------------------------------------------------------------------- sliders.connected_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.connected)) sliders.disconnected_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.disconnected)) sliders.opendialog_volume_slider = new.float(tonumber(config.ini.ugenrl_volume.opendialog)) ---------------------- [ редактор элементов интерфейса] -------- sliders.posPatronsX = new.float(tonumber(preset["Patrons"]["posPatronsX"])) sliders.posPatronsY = new.float(tonumber(preset["Patrons"]["posPatronsY"])) sliders.sizePatronsX = new.float(tonumber(preset["Patrons"]["sizePatronsX"])) sliders.sizePatronsY = new.float(tonumber(preset["Patrons"]["sizePatronsY"])) sliders.posHealthX = new.float(tonumber(preset["Health"]["posHealthX"])) sliders.posHealthY = new.float(tonumber(preset["Health"]["posHealthY"])) sliders.sizeHealthX = new.float(tonumber(preset["Health"]["sizeHealthX"])) sliders.sizeHealthY = new.float(tonumber(preset["Health"]["sizeHealthY"])) sliders.posMoneyX = new.float(tonumber(preset["Money"]["posMoneyX"])) sliders.posMoneyY = new.float(tonumber(preset["Money"]["posMoneyY"])) sliders.sizeMoneyX = new.float(tonumber(preset["Money"]["sizeMoneyX"])) sliders.sizeMoneyY = new.float(tonumber(preset["Money"]["sizeMoneyY"])) sliders.posBreathX = new.float(tonumber(preset["Breath"]["posBreathX"])) sliders.posBreathY = new.float(tonumber(preset["Breath"]["posBreathY"])) sliders.sizeBreathX = new.float(tonumber(preset["Breath"]["sizeBreathX"])) sliders.sizeBreathY = new.float(tonumber(preset["Breath"]["sizeBreathY"])) sliders.posArmorX = new.float(tonumber(preset["Armor"]["posArmorX"])) sliders.posArmorY = new.float(tonumber(preset["Armor"]["posArmorY"])) sliders.sizeArmorX = new.float(tonumber(preset["Armor"]["sizeArmorX"])) sliders.sizeArmorY = new.float(tonumber(preset["Armor"]["sizeArmorY"])) sliders.posWeaponX = new.float(tonumber(preset["Weapon"]["posWeaponX"])) sliders.posWeaponY = new.float(tonumber(preset["Weapon"]["posWeaponY"])) sliders.sizeWeaponX = new.float(tonumber(preset["Weapon"]["sizeWeaponX"])) sliders.sizeWeaponY = new.float(tonumber(preset["Weapon"]["sizeWeaponY"])) sliders.posWantedX = new.float(tonumber(preset["Wanted"]["posWantedX"])) sliders.posWantedY = new.float(tonumber(preset["Wanted"]["posWantedY"])) sliders.sizeWantedX = new.float(tonumber(preset["Wanted"]["sizeWantedX"])) sliders.sizeWantedY = new.float(tonumber(preset["Wanted"]["sizeWantedY"])) sliders.spaceWanted = new.float(tonumber(preset["Wanted"]["spaceWanted"])) sliders.posClockX = new.float(tonumber(preset["Clock"]["posClockX"])) sliders.posClockY = new.float(tonumber(preset["Clock"]["posClockY"])) sliders.sizeClockX = new.float(tonumber(preset["Clock"]["sizeClockX"])) sliders.sizeClockY = new.float(tonumber(preset["Clock"]["sizeClockY"])) --------------------------- [checkboxes] --------------------------- checkboxes.bladeSound = new.bool(config.ini.settings.bladeSound) checkboxes.heliEngineSound = new.bool(config.ini.settings.heliEngineSound) checkboxes.staticLight = new.bool(config.ini.settings.staticLight) checkboxes.KillListChange = new.bool(config.ini.settings.KillListChange) checkboxes.FixUnderBridgeForRain = new.bool(config.ini.settings.FixUnderBridgeForRain) checkboxes.inputPatch = new.bool(config.ini.settings.inputPatch) checkboxes.NetStatsWithHud = new.bool(config.ini.settings.NetStatsWithHud) checkboxes.connectedSound = new.bool(config.ini.settings.connectedSound) checkboxes.disconnectSound = new.bool(config.ini.settings.disconnectSound) checkboxes.opendialogSound = new.bool(config.ini.settings.opendialogSound) checkboxes.paralandingfix = new.bool(config.ini.settings.paralandingfix) checkboxes.sightObjectsFix = new.bool(config.ini.settings.sightObjectsFix) checkboxes.swingingfix = new.bool(config.ini.settings.swingingfix) checkboxes.aisens = new.bool(config.ini.settings.aisens) checkboxes.aspectratio_status = new.bool(config.ini.settings.aspectratio_status) checkboxes.fastquit = new.bool(config.ini.settings.fastquit) checkboxes.vehCameraTweak = new.bool(config.ini.settings.vehCameraTweak) checkboxes.givemebrightness = new.bool(config.ini.settings.givemebrightness) checkboxes.swimFix = new.bool(config.ini.settings.swimFix) checkboxes.ovalityCorrection = new.bool(config.ini.settings.ovalityCorrection) checkboxes.borderchild_draw = new.bool(config.ini.borderchild.draw) checkboxes.anticrash = new.bool(config.ini.settings.anticrash) checkboxes.blockweather = new.bool(config.ini.settings.blockweather) checkboxes.blocktime = new.bool(config.ini.settings.blocktime) checkboxes.sync_time = new.bool(config.ini.settings.sync_time) checkboxes.gtatime = new.bool(config.ini.settings.gtatime) checkboxes.gtaweather = new.bool(config.ini.settings.gtaweather) checkboxes.noRain = new.bool(config.ini.settings.noRain) checkboxes.noFog = new.bool(config.ini.settings.noFog) checkboxes.noSandstorm = new.bool(config.ini.settings.noSandstorm) checkboxes.antiblockedplayer = new.bool(config.ini.settings.antiblockedplayer) checkboxes.chatt = new.bool(config.ini.settings.chatt) checkboxes.fixblackroads = new.bool(config.ini.settings.fixblackroads) checkboxes.longarmfix = new.bool(config.ini.settings.longarmfix) checkboxes.waterfixquadro = new.bool(config.ini.settings.waterfixquadro) checkboxes.intrun = new.bool(config.ini.settings.intrun) checkboxes.cleaninfo = new.bool(config.ini.cleaner.cleaninfo) checkboxes.emptyStars = new.bool(preset["Wanted"]["emptyStars"]) checkboxes.mapzoom = new.bool(preset["MenuPause"]["mapzoom"]) checkboxes.sunfix = new.bool(config.ini.settings.sunfix) checkboxes.radarfix = new.bool(preset["Radar"]["radarfix"]) checkboxes.minimapzoom = new.bool(preset["Radar"]["minimapzoom"]) checkboxes.radardisc = new.bool(preset["Radar"]["radardisc"]) checkboxes.vehtaxilight = new.bool(config.ini.effects_manager.vehtaxilight) checkboxes.forceaniso = new.bool(config.ini.settings.forceaniso) checkboxes.mapzoomfixer = new.bool(preset["MenuPause"]["mapzoomfixer"]) checkboxes.dual_monitor_fix = new.bool(config.ini.settings.dual_monitor_fix) checkboxes.radar_color_fix = new.bool(preset["Radar"]["radar_color_fix"]) checkboxes.nop_samp_keys_F4 = new.bool(config.ini.nop_samp_keys.key_F4) checkboxes.nop_samp_keys_F7 = new.bool(config.ini.nop_samp_keys.key_F7) checkboxes.nop_samp_keys_T = new.bool(config.ini.nop_samp_keys.key_T) checkboxes.nop_samp_keys_ALTENTER = new.bool(config.ini.nop_samp_keys.key_ALTENTER) checkboxes.nop_samp_keys_PgUp_PgDn = new.bool(config.ini.nop_samp_keys.key_PgUp_PgDn) checkboxes.hphud = new.bool(preset["HPHud"]["Status"]) checkboxes.oneHundredAndSixtyHPbar = new.bool(preset["Health"]["oneHundredAndSixtyHPbar"]) checkboxes.hpt = new.bool(preset["HPHud"]["hptext"]) checkboxes.armorhud = new.bool(preset["ArmorHud"]["Status"]) checkboxes.armortext = new.bool(preset["ArmorHud"]["armortext"]) checkboxes.fixtimecyc = new.bool(config.ini.fixtimecyc.active) checkboxes.givemedist = new.bool(config.ini.settings.givemedist) checkboxes.shadowedit = new.bool(config.ini.settings.shadowedit) checkboxes.givemedistnames = new.bool(config.ini.settings.givemedistnames) checkboxes.autoclean = new.bool(config.ini.cleaner.autoclean) checkboxes.sounds = new.bool(config.ini.settings.sounds) checkboxes.noradio = new.bool(config.ini.settings.noradio) checkboxes.intmusic = new.bool(config.ini.settings.intmusic) checkboxes.audiostream = new.bool(config.ini.settings.audiostream) checkboxes.targetblip = new.bool(preset["Other"]["targetblip"]) checkboxes.fixloadmap = new.bool(preset["MenuPause"]["fixloadmap"]) checkboxes.helptext = new.bool(preset["MenuPause"]["helptext"]) checkboxes.beginmenu = new.bool(preset["MenuPause"]["beginmenu"]) checkboxes.treepitching = new.bool(config.ini.settings.treepitching) checkboxes.fixbloodwood = new.bool(config.ini.settings.fixbloodwood) checkboxes.refreshratefix = new.bool(config.ini.settings.refreshratefix) checkboxes.vsync = new.bool(config.ini.settings.vsync) checkboxes.framelimiter = new.bool(config.ini.settings.framelimiter) checkboxes.recolorer = new.bool(preset["Recolorer"]["Recolorer"]) checkboxes.patchduck = new.bool(config.ini.settings.patchduck) checkboxes.FixArrowPassMotoBike = new.bool(config.ini.settings.FixArrowPassMotoBike) checkboxes.nocrosshaireditsize = new.bool(preset["Crosshair"]["nocrosshaireditsize"]) checkboxes.renderammo = new.bool(preset["Patrons"]["renderammo"]) checkboxes.singleclip = new.bool(preset["Patrons"]["singleclip"]) checkboxes.EternalPatrons = new.bool(preset["Patrons"]["EternalPatrons"]) ----------------- [ugenrl] ---------------------------- checkboxes.ugenrl_enable = new.bool(config.ini.ugenrl_main.enable) checkboxes.weapon_checkbox = new.bool(config.ini.ugenrl_main.weapon) checkboxes.enemyweapon_checkbox = new.bool(config.ini.ugenrl_main.enemyWeapon) checkboxes.hit_checkbox = new.bool(config.ini.ugenrl_main.hit) checkboxes.pain_checkbox = new.bool(config.ini.ugenrl_main.pain) checkboxes.kill_checkbox = new.bool(config.ini.ugenrl_main.kill) --------------------------------------------------------- checkboxes.showchat = new.bool(preset["Other"]["showchat"]) checkboxes.shownicks = new.bool(config.ini.settings.shownicks) checkboxes.showhp = new.bool(config.ini.settings.showhp) checkboxes.showhud = new.bool(preset["Other"]["showhud"]) checkboxes.unlimitfps = new.bool(config.ini.settings.unlimitfps) checkboxes.postfx = new.bool(config.ini.effects_manager.postfx) checkboxes.nocloudsmall = new.bool(config.ini.effects_manager.nocloudsmall) checkboxes.nocloudbig = new.bool(config.ini.effects_manager.nocloudbig) checkboxes.nocloudhorizont = new.bool(config.ini.effects_manager.nocloudhorizont) checkboxes.nobirds = new.bool(config.ini.effects_manager.nobirds) checkboxes.pedshadows = new.bool(config.ini.settings.pedshadows) checkboxes.vehshadows = new.bool(config.ini.settings.vehshadows) checkboxes.poleshadows = new.bool(config.ini.settings.poleshadows) checkboxes.bestshadows = new.bool(config.ini.settings.bestshadows) checkboxes.nowind = new.bool(config.ini.settings.nowind) checkboxes.MenuPauseSound = new.bool(config.ini.settings.MenuPauseSound) checkboxes.noplaneline = new.bool(config.ini.effects_manager.noplaneline) checkboxes.tiretracks = new.bool(config.ini.effects_manager.tiretracks) checkboxes.custom_nametags = new.bool(config.ini.custom_nametags.status) checkboxes.renderWeapon = new.bool(config.ini.custom_nametags.renderWeapon) checkboxes.renderFon = new.bool(config.ini.custom_nametags.renderFon) checkboxes.whiteId = new.bool(config.ini.custom_nametags.whiteId) checkboxes.moneyzerofix = new.bool(preset["Money"]["moneyzerofix"]) checkboxes.givemedistobj = new.bool(config.ini.settings.givemedistobj) checkboxes.fullmenuimage = new.bool(preset["MenuPause"]["fullmenuimage"]) checkboxes.smalliconsradar = new.bool( preset["Radar"]["smalliconsradar"]) checkboxes.radrarnorth = new.bool(preset["Radar"]["radrarnorth"]) checkboxes.arrowicon_menu = new.bool(preset["MenuPause"]["arrowicon_menu"]) checkboxes.vehspec = new.bool(config.ini.effects_manager.vehspec) checkboxes.nosparks = new.bool(config.ini.effects_manager.nosparks) checkboxes.nowaterfog = new.bool(config.ini.effects_manager.nowaterfog) checkboxes.nogunfire = new.bool(config.ini.effects_manager.nogunfire) checkboxes.nogunsmoke = new.bool(config.ini.effects_manager.nogunsmoke) checkboxes.nofxsystem = new.bool(config.ini.effects_manager.nofxsystem) checkboxes.noblood = new.bool(config.ini.effects_manager.noblood) checkboxes.noexhaust = new.bool(config.ini.effects_manager.noexhaust) checkboxes.noSmokeCplane = new.bool(config.ini.effects_manager.noSmokeCplane) checkboxes.wheelsand = new.bool(config.ini.effects_manager.wheelsand) checkboxes.wheeldust = new.bool(config.ini.effects_manager.wheeldust) checkboxes.wheelmud = new.bool(config.ini.effects_manager.wheelmud) checkboxes.wheelgravel = new.bool(config.ini.effects_manager.wheelgravel) checkboxes.wheelgrass = new.bool(config.ini.effects_manager.wheelgrass) checkboxes.wheelspray = new.bool(config.ini.effects_manager.wheelspray) checkboxes.vehsparks = new.bool(config.ini.effects_manager.vehsparks) checkboxes.nodust = new.bool(config.ini.effects_manager.nodust) checkboxes.gunshell = new.bool(config.ini.effects_manager.gunshell) checkboxes.teargas = new.bool(config.ini.effects_manager.teargas) checkboxes.footprints = new.bool(config.ini.effects_manager.footprints) checkboxes.nohealthflick = new.bool(config.ini.settings.nohealthflick) checkboxes.swim = new.bool(config.ini.effects_manager.swim) checkboxes.vehdust = new.bool(config.ini.effects_manager.vehdust) checkboxes.vehdmgdust = new.bool(config.ini.effects_manager.vehdmgdust) checkboxes.footdust = new.bool(config.ini.effects_manager.footdust) checkboxes.vehdmgsmoke = new.bool(config.ini.effects_manager.vehdmgsmoke) checkboxes.breakobject = new.bool(config.ini.effects_manager.breakobject) checkboxes.nomorehaze = new.bool(config.ini.effects_manager.nomorehaze) checkboxes.reflectionwater = new.bool(config.ini.effects_manager.reflectionwater) checkboxes.fireworld = new.bool(config.ini.effects_manager.fireworld) checkboxes.timecyc_creator = new.bool(false) ----------------------[ Редактор элементов интерфейса ]--------------------------- checkboxes.EditPatrons = new.bool(preset["Patrons"]["EditPatrons"]) checkboxes.EditHealth = new.bool(preset["Health"]["EditHealth"]) checkboxes.healthborder = new.bool(preset["Health"]["healthborder"]) checkboxes.EditMoney = new.bool(preset["Money"]["EditMoney"]) checkboxes.EditBreath = new.bool(preset["Breath"]["EditBreath"]) checkboxes.breathborder = new.bool(preset["Breath"]["breathborder"]) checkboxes.eternalBreath = new.bool(preset["Breath"]["eternalBreath"]) checkboxes.EditArmor = new.bool(preset["Armor"]["EditArmor"]) checkboxes.armorborder = new.bool(preset["Armor"]["armorborder"]) checkboxes.eternalArmor = new.bool(preset["Armor"]["eternalArmor"]) checkboxes.EditWeapon = new.bool(preset["Weapon"]["EditWeapon"]) checkboxes.EditWanted = new.bool(preset["Wanted"]["EditWanted"]) checkboxes.eternalwanted = new.bool(preset["Wanted"]["eternalwanted"]) checkboxes.EditClock = new.bool(preset["Clock"]["EditClock"]) checkboxes.DrawClock = new.bool(preset["Clock"]["DrawClock"]) checkboxes.PcClock = new.bool(preset["Clock"]["PcClock"]) checkboxes.DrawSec = new.bool(preset["Clock"]["DrawSec"]) --------------------------------------------------------- checkboxes.MotionBlur = new.bool(config.ini.effects_manager.MotionBlur) checkboxes.noWeatherFlash = new.bool(config.ini.effects_manager.noweatherflash) checkboxes.noRainyFog = new.bool(config.ini.effects_manager.noRainyFog) checkboxes.noPointLight = new.bool(config.ini.effects_manager.noPointLight) checkboxes.vehiclenames = new.bool(config.ini.settings.vehiclenames) checkboxes.areanames = new.bool(config.ini.settings.areanames) checkboxes.reflections = new.bool(config.ini.settings.reflections) checkboxes.no3dTextPlayers = new.bool(config.ini.settings.no3dTextPlayers) checkboxes.no3dTextVehicles = new.bool(config.ini.settings.no3dTextVehicles) checkboxes.gxtEntryEditor = new.bool(preset["MenuPause"]["gxtEntryEditor"]) checkboxes.useMynameInBeginMenu = new.bool(preset["MenuPause"]["useMynameInBeginMenu"]) ------------------- [buffers] -------------------------- buffers.crosshairX = new.float(tonumber(preset["Crosshair"]["crosshairSizeX"])) buffers.crosshairY = new.float(tonumber(preset["Crosshair"]["crosshairSizeY"])) buffers.fullmenuheight = new.float(tonumber(preset["MenuPause"]["fullmenuheight"])) buffers.fullmenuwidth = new.float(tonumber(preset["MenuPause"]["fullmenuwidth"])) buffers.beginText = new.char[64](u8(preset["MenuPause"]["beginText"])) buffers.resume = new.char[64](u8(preset["MenuPause"]["resume"])) buffers.start_new_game = new.char[64](u8(preset["MenuPause"]["start_new_game"])) buffers.map = new.char[64](u8(preset["MenuPause"]["map"])) buffers.stats = new.char[64](u8(preset["MenuPause"]["stats"])) buffers.brief = new.char[64](u8(preset["MenuPause"]["brief"])) buffers.settings = new.char[64](u8(preset["MenuPause"]["settings"])) buffers.quitGame = new.char[64](u8(preset["MenuPause"]["quitGame"])) buffers.cnt_fontname = new.char[64](config.ini.custom_nametags.fontName) buffers.cmd_openmenu = new.char[64](config.ini.commands.openmenu) buffers.cmd_settime = new.char[64](config.ini.commands.settime) buffers.cmd_setweather = new.char[64](config.ini.commands.setweather) buffers.cmd_blockservertime = new.char[64](config.ini.commands.blockservertime) buffers.cmd_blockserverweather = new.char[64](config.ini.commands.blockserverweather) buffers.cmd_givemedist = new.char[64](config.ini.commands.givemedist) buffers.cmd_givemedistnames = new.char[64](config.ini.commands.givemedistnames) buffers.cmd_drawdistance = new.char[64](config.ini.commands.drawdistance) buffers.cmd_drawdistanceair = new.char[64](config.ini.commands.drawdistanceair) buffers.cmd_drawdistancepara = new.char[64](config.ini.commands.drawdistancepara) buffers.cmd_fogdistance = new.char[64](config.ini.commands.fogdistance) buffers.cmd_loddistance = new.char[64](config.ini.commands.loddistance) buffers.cmd_shownicks = new.char[64](config.ini.commands.shownicks) buffers.cmd_showhp = new.char[64](config.ini.commands.showhp) buffers.cmd_showchat = new.char[64](config.ini.commands.showchat) buffers.cmd_showhud = new.char[64](config.ini.commands.showhud) buffers.cmd_fpslock = new.char[64](config.ini.commands.fpslock) buffers.cmd_postfx = new.char[64](config.ini.commands.postfx) buffers.cmd_ntgs = new.char[64](config.ini.commands.ntgs) buffers.cmd_autocleaner = new.char[64](config.ini.commands.autocleaner) buffers.cmd_cleanmemory = new.char[64](config.ini.commands.cleanmemory) buffers.cmd_cleaninfo = new.char[64](config.ini.commands.cleaninfo) buffers.cmd_setmbforautocleaner = new.char[64](config.ini.commands.setmbforautocleaner) buffers.cmd_opentimecyccreator = new.char[64](config.ini.commands.opentimecyccreator) buffers.cmd_editcrosshair = new.char[64](config.ini.commands.editcrosshair) buffers.cmd_givemedistobj = new.char[64](config.ini.commands.givemedistobj) buffers.cmd_tws = new.char[64](config.ini.commands.tws) buffers.cmd_setfps = new.char[64](config.ini.commands.setfps) buffers.cmd_vehfps = new.char[64](config.ini.commands.vehfps) buffers.cmd_bikefps = new.char[64](config.ini.commands.bikefps) buffers.cmd_motofps = new.char[64](config.ini.commands.motofps) buffers.cmd_boatfps = new.char[64](config.ini.commands.boatfps) buffers.cmd_planefps = new.char[64](config.ini.commands.planefps) buffers.cmd_helifps = new.char[64](config.ini.commands.helifps) buffers.cmd_swimfps = new.char[64](config.ini.commands.swimfps) buffers.cmd_snipergunfps = new.char[64](config.ini.commands.snipergunfps) buffers.cmd_spraygunfps = new.char[64](config.ini.commands.spraygunfps) ------------------- [icolors] ---------------------------- icolors.wamb = new.float[3](config.ini.fixtimecyc.worldambientR, config.ini.fixtimecyc.worldambientG, config.ini.fixtimecyc.worldambientB) icolors.PLeftUp = new.float[4](config.ini.PLeftUp.r, config.ini.PLeftUp.g, config.ini.PLeftUp.b, config.ini.PLeftUp.a) icolors.PLeftDown = new.float[4](config.ini.PLeftDown.r, config.ini.PLeftDown.g, config.ini.PLeftDown.b, config.ini.PLeftDown.a) icolors.PRightUp = new.float[4](config.ini.PRightUp.r, config.ini.PRightUp.g, config.ini.PRightUp.b, config.ini.PRightUp.a) icolors.PRightDown = new.float[4](config.ini.PRightDown.r, config.ini.PRightDown.g, config.ini.PRightDown.b, config.ini.PRightDown.a) icolors.WindowBG = new.float[4](config.ini.WindowBG.r, config.ini.WindowBG.g, config.ini.WindowBG.b, config.ini.WindowBG.a) icolors.BaseColor = new.float[4](config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, config.ini.BaseColor.a) icolors.СolorChildMenu = new.float[4](config.ini.СolorChildMenu.r, config.ini.СolorChildMenu.g, config.ini.СolorChildMenu.b, config.ini.СolorChildMenu.a) icolors.ColorNavi = new.float[4](config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a) icolors.ColorTop = new.float[4](config.ini.ColorTop.r, config.ini.ColorTop.g, config.ini.ColorTop.b, config.ini.ColorTop.a) icolors.ActiveText = new.float[4](config.ini.ActiveText.r, config.ini.ActiveText.g, config.ini.ActiveText.b, config.ini.ActiveText.a) icolors.PassiveText = new.float[4](config.ini.PassiveText.r, config.ini.PassiveText.g, config.ini.PassiveText.b, config.ini.PassiveText.a) icolors.ColorText = new.float[4](config.ini.ColorText.r, config.ini.ColorText.g, config.ini.ColorText.b, config.ini.ColorText.a) icolors.FrameBg = new.float[4](config.ini.FrameBg.r, config.ini.FrameBg.g, config.ini.FrameBg.b, config.ini.FrameBg.a) icolors.FrameBgHovered = new.float[4](config.ini.FrameBgHovered.r, config.ini.FrameBgHovered.g, config.ini.FrameBgHovered.b, config.ini.FrameBgHovered.a) icolors.FrameBgActive = new.float[4](config.ini.FrameBgActive.r, config.ini.FrameBgActive.g, config.ini.FrameBgActive.b, config.ini.FrameBgActive.a) icolors.CheckMark = new.float[4](config.ini.CheckMark.r, config.ini.CheckMark.g, config.ini.CheckMark.b, config.ini.CheckMark.a) icolors.SliderGrab = new.float[4](config.ini.SliderGrab.r, config.ini.SliderGrab.g, config.ini.SliderGrab.b, config.ini.SliderGrab.a) icolors.SliderGrabActive = new.float[4](config.ini.SliderGrabActive.r, config.ini.SliderGrabActive.g, config.ini.SliderGrabActive.b, config.ini.SliderGrabActive.a) icolors.Button = new.float[4](config.ini.Button.r, config.ini.Button.g, config.ini.Button.b, config.ini.Button.a) icolors.ButtonHovered = new.float[4](config.ini.ButtonHovered.r, config.ini.ButtonHovered.g, config.ini.ButtonHovered.b, config.ini.ButtonHovered.a) icolors.ButtonActive = new.float[4](config.ini.ButtonActive.r, config.ini.ButtonActive.g, config.ini.ButtonActive.b, config.ini.ButtonActive.a) icolors.Header = new.float[4](config.ini.Header.r, config.ini.Header.g, config.ini.Header.b, config.ini.Header.a) icolors.HeaderHovered = new.float[4](config.ini.HeaderHovered.r, config.ini.HeaderHovered.g, config.ini.HeaderHovered.b, config.ini.HeaderHovered.a) icolors.HeaderActive = new.float[4](config.ini.HeaderActive.r, config.ini.HeaderActive.g, config.ini.HeaderActive.b, config.ini.HeaderActive.a) icolors.ScrollbarBg = new.float[4](config.ini.ScrollbarBg.r, config.ini.ScrollbarBg.g, config.ini.ScrollbarBg.b, config.ini.ScrollbarBg.a) icolors.ScrollbarGrab = new.float[4](config.ini.ScrollbarGrab.r, config.ini.ScrollbarGrab.g, config.ini.ScrollbarGrab.b, config.ini.ScrollbarGrab.a) icolors.ScrollbarGrabHovered = new.float[4](config.ini.ScrollbarGrabHovered.r, config.ini.ScrollbarGrabHovered.g, config.ini.ScrollbarGrabHovered.b, config.ini.ScrollbarGrabHovered.a) icolors.ScrollbarGrabActive = new.float[4](config.ini.ScrollbarGrabActive.r, config.ini.ScrollbarGrabActive.g, config.ini.ScrollbarGrabActive.b, config.ini.ScrollbarGrabActive.a) icolors.LogoColor = new.float[4](config.ini.logocolor.r, config.ini.logocolor.g, config.ini.logocolor.b, config.ini.logocolor.a) icolors.BeginColor = new.float[4](config.ini.BeginColor.r, config.ini.BeginColor.g, config.ini.BeginColor.b, config.ini.BeginColor.a) icolors.mainBoxColor = new.float[4](config.ini.mainBoxColor.r, config.ini.mainBoxColor.g, config.ini.mainBoxColor.b, config.ini.mainBoxColor.a) icolors.mainBoxColorUP = new.float[4](config.ini.mainBoxColorUP.r, config.ini.mainBoxColorUP.g, config.ini.mainBoxColorUP.b, config.ini.mainBoxColorUP.a) -------------------------------------------- icolors.RECOLORER_HEALTH = new.float[4](explode_rgba(preset["Recolorer"]["Health"])) icolors.RECOLORER_ARMOUR = new.float[4](explode_rgba(preset["Recolorer"]["Armor"])) icolors.RECOLORER_PLAYERHEALTH = new.float[4](explode_rgba(preset["Recolorer"]["PlayerHealth"])) icolors.RECOLORER_PLAYERHEALTH2 = new.float[4](explode_rgba(preset["Recolorer"]["PlayerHealth2"])) icolors.RECOLORER_PLAYERARMOR = new.float[4](explode_rgba(preset["Recolorer"]["PlayerArmor"])) icolors.RECOLORER_PLAYERARMOR2 = new.float[4](explode_rgba(preset["Recolorer"]["PlayerArmor2"])) icolors.RECOLORER_MONEY = new.float[4](explode_rgba(preset["Recolorer"]["Money"])) icolors.RECOLORER_STARS = new.float[4](explode_rgba(preset["Recolorer"]["Stars"])) icolors.RECOLORER_PATRONS = new.float[4](explode_rgba(preset["Recolorer"]["Patrons"])) icolors.IndicatorHP_color = new.float[4](explode_rgba(preset["HPHud"]["Color"])) icolors.IndicatorARMOR_color = new.float[4](explode_rgba(preset["ArmorHud"]["Color"])) ---------------------------- [ other ] ----------------------------- selectedPriorityIndex = new.int(tonumber(config.ini.settings.PriorityClass)) fontFlag = new.int(tonumber(config.ini.custom_nametags.fontFlag - 1)) ivar = new.int(tonumber(preset["Money"]["animmoney"])) gmodevar = new.int(tonumber(config.ini.ugenrl_main.mode)) typebarsvar = new.int(tonumber(config.ini.custom_nametags.typebars)) typebarsformavar = new.int(tonumber(config.ini.custom_nametags.typebarsforma)) fontmoneybordervar = new.int(tonumber(preset["Money"]["fontmoneyborder"])) fontoutlineclockvar = new.int(tonumber(preset["Clock"]["fontoutlineclock"])) fontmoneystylevar = new.int(tonumber(preset["Money"]["fontmoneystyle"])) posdollarvar = new.int(tonumber(preset["Money"]["posdollar"])) fontammostylevar = new.int(tonumber(preset["Patrons"]["fontammostyle"])) fontstyleclockvar = new.int(tonumber(preset["Clock"]["fontstyleclock"])) fontmenubasestylevar = new.int(tonumber(preset["MenuPause"]["fontmenubasestyle"])) fontmenuheaderstylevar = new.int(tonumber(preset["MenuPause"]["fontmenuheaderstyle"])) fontmenutumblerstylevar = new.int(tonumber(preset["MenuPause"]["fontmenutumblerstyle"])) fontstylehpvar = new.int(tonumber(preset["HPHud"]["fonts"])) fontstylearmvar = new.int(tonumber(preset["ArmorHud"]["fonts"])) radarTypeVar = new.int(tonumber(preset["Radar"]["Type"])) --------------------------------------------------------------------- end imgui_Data() -- const data buffers.multilineText = new.char[100000]() buffers.IEpresetName = new.char[128]() --------------------------------------------------------------- local priorityClasses = { {name = u8"Низкий", value = 0x00004000}, {name = u8"Выше среднего", value = 0x00008000}, {name = u8"Нормальный", value = 0x00000020}, {name = u8"Высокий", value = 0x00000080}, --{name = u8"Реального времени", value = 0x00000100} -- опасно! (может вызвать синий экран смерти) } local names = {} for _, priority in ipairs(priorityClasses) do table.insert(names, priority.name) end local priorityClassesText = imgui.new['const char*'][#names](names) local imguiInputsCmdEditor = { [u8"Открыть меню скрипта"] = {var = buffers.cmd_openmenu, cfg = "openmenu"}, [u8"Открыть меню редактора погоды и времени"] = {var = buffers.cmd_tws, cfg = "tws"}, [u8"Изменить время"] = {var = buffers.cmd_settime, cfg = "settime"}, [u8"Изменить погоду"] = {var = buffers.cmd_setweather, cfg = "setweather"}, [u8"Блокировать изменение времени сервером"] = {var = buffers.cmd_blockservertime, cfg = "blockservertime"}, [u8"Блокировать изменение погоды сервером"] = {var = buffers.cmd_blockserverweather, cfg = "blockserverweather"}, [u8"[ON | OFF] возможность менять прорисовку"] = {var = buffers.cmd_givemedist, cfg = "givemedist"}, [u8"Изменить дальность прорисовки"] = {var = buffers.cmd_drawdistance, cfg = "drawdistance"}, [u8"Изменить дальность прорисовки для воздушного транспорта"] = {var = buffers.cmd_drawdistanceair, cfg = "drawdistanceair"}, [u8"Изменить дальность прорисовки при использовании парашюта"] = {var = buffers.cmd_drawdistancepara, cfg = "drawdistancepara"}, [u8"Изменить дальность тумана"] = {var = buffers.cmd_fogdistance, cfg = "fogdistance"}, [u8"Изменить дальность лодов"] = {var = buffers.cmd_loddistance, cfg = "loddistance"}, [u8"Скрыть чат"] = {var = buffers.cmd_showchat, cfg = "showchat"}, [u8"Скрыть HUD"] = {var = buffers.cmd_showhud, cfg = "showhud"}, [u8"Показать / Скрыть ники игроков"] = {var = buffers.cmd_shownicks, cfg = "shownicks"}, [u8"Показать / Скрыть ХП игроков"] = {var = buffers.cmd_showhp, cfg = "showhp"}, [u8"[ON | OFF] ограничитель фпс"] = {var = buffers.cmd_fpslock, cfg = "fpslock"}, [u8"[ON | OFF] пост-обработку"] = {var = buffers.cmd_postfx, cfg = "postfx"}, [u8"[ON | OFF] авто-очистку памяти"] = {var = buffers.cmd_autocleaner, cfg = "autocleaner"}, [u8"Очистить память"] = {var = buffers.cmd_cleanmemory, cfg = "cleanmemory"}, [u8"[ON | OFF] сообщение об очистке памяти"] = {var = buffers.cmd_cleaninfo, cfg = "cleaninfo"}, [u8"Установить лимит в мегабайтах для авто-очистки памяти"] = {var = buffers.cmd_setmbforautocleaner, cfg = "setmbforautocleaner"}, [u8"Открыть меню редактора таймцикла"] = {var = buffers.cmd_opentimecyccreator, cfg = "opentimecyccreator"}, [u8"Изменить размер прицела"] = {var = buffers.cmd_editcrosshair, cfg = "editcrosshair"}, [u8"Изменить дистанцию прорисовки никнеймов"] = {var = buffers.cmd_ntgs, cfg = "ntgs"}, [u8"[ON | OFF] возможность менять дальность видимости объектов"] = {var = buffers.cmd_givemedistobj, cfg = "givemedistobj"}, [u8"[ON | OFF] возможность менять прорисовку никнеймов"] = {var = buffers.cmd_givemedistnames, cfg = "givemedistnames"}, [u8"Изменить фпс с ног"] = {var = buffers.cmd_setfps, cfg = "setfps"}, [u8"Изменить фпс в авто"] = {var = buffers.cmd_vehfps, cfg = "vehfps"}, [u8"Изменить фпс в велосипедах"] = {var = buffers.cmd_bikefps, cfg = "bikefps"}, [u8"Изменить фпс в мотоциклах"] = {var = buffers.cmd_motofps, cfg = "motofps"}, [u8"Изменить фпс в лодках"] = {var = buffers.cmd_boatfps, cfg = "boatfps"}, [u8"Изменить фпс в самолетах"] = {var = buffers.cmd_planefps, cfg = "planefps"}, [u8"Изменить фпс в вертолетах"] = {var = buffers.cmd_helifps, cfg = "helifps"}, [u8"Изменить фпс во время плавания"] = {var = buffers.cmd_swimfps, cfg = "swimfps"}, [u8"Изменить фпс снайперки"] = {var = buffers.cmd_snipergunfps, cfg = "snipergunfps"}, [u8"Изменить фпс Spray Can"] = {var = buffers.cmd_spraygunfps, cfg = "cmd_spraygunfps"}, } local imguiCheckboxesPatches = { [u8"Открывать чат на Е (Для этой функции не работает блокировка клавиши T)"] = {var = checkboxes.chatt, cfg = "chatt", fnc = "_"}, [u8"Вернуть солнце"] = {var = checkboxes.sunfix, cfg = "sunfix", fnc = "SunFix"}, [u8"Отключить покачивание деревьев в ветренную погоду"] = {var = checkboxes.treepitching, cfg = "treepitching", fnc = "TreePitching"}, [u8"Патч анимации приседа с оружием, можно сесть с любым оружием"] = {var = checkboxes.patchduck, cfg = "patchduck", fnc = "PatchDuck"}, [u8"Патч бага со стрелочкой, можно разгоняться на 2-х колесном т/c с пассажиром"] = {var = checkboxes.FixArrowPassMotoBike, cfg = "FixArrowPassMotoBike", fnc = "FixArrowPassMotoBike"}, [u8"AntiCrash - защита от случайных крашей которые могут возникнуть в процессе игры"] = {var = checkboxes.anticrash, cfg = "anticrash", fnc = "AntiCrash"}, [u8"Вернуть отображение названия транспорта при посадке"] = {var = checkboxes.vehiclenames, cfg = "vehiclenames", fnc = "VehicleNames"}, [u8"Вернуть отображение названия районов"] = {var = checkboxes.areanames, cfg = "areanames", fnc = "AreaNames"}, [u8"Отключить зеркала"] = {var = checkboxes.reflections, cfg = "reflections", fnc = "Reflections"}, [u8"Быстрый выход из игры при /q"] = {var = checkboxes.fastquit, cfg = "fastquit", fnc = "_"}, [u8"Отключить аксессуары при прицеливании (sniper, cam, rpg)"] = {var = checkboxes.sightObjectsFix, cfg = "sightObjectsFix", fnc = "_"}, [u8"Возможность бегать в интерьерах"] = {var = checkboxes.intrun, cfg = "intrun", fnc = "InteriorRun"}, [u8"Отключить выход мышки на второй монитор"] = {var = checkboxes.dual_monitor_fix, cfg = "dual_monitor_fix", fnc = "_"}, [u8"Поддержка 75 + гц (+ фикс медленного ALT+TAB)"] = {var = checkboxes.refreshratefix, cfg = "refreshratefix", fnc = "updateWindow"}, [u8"Не застревать в других игроках при спавне"] = {var = checkboxes.antiblockedplayer, cfg = "antiblockedplayer", fnc = "_"}, [u8"Не скрывать HUD при открытом NetStats"] = {var = checkboxes.NetStatsWithHud, cfg = "NetStatsWithHud", fnc = "NetStatsWithHud"}, [u8"Не скрывать поле ввода чата если сервер покажет вам диалог"] = {var = checkboxes.inputPatch, cfg = "inputPatch", fnc = "InputPatch"}, --[u8"Многоядерная обработка RenderWare"] = {var = new.bool(false), cfg = "_", fnc = "_"}, } local imguiCheckboxesFixes = { [u8"Исправление черных дорог"] = {var = checkboxes.fixblackroads, cfg = "fixblackroads", fnc = "FixBlackRoads"}, [u8"Исправление длинных рук при езде на 2-х колесном т/с"] = {var = checkboxes.longarmfix, cfg = "longarmfix", fnc = "FixLongArm"}, [u8"Исправление квадратной воды"] = {var = checkboxes.waterfixquadro, cfg = "waterfixquadro", fnc = "FixWaterQuadro"}, [u8"Исправление ряби на текстурах [Анизотропная фильтрация]"] = {var = checkboxes.forceaniso, cfg = "forceaniso", fnc = "ForceAniso"}, [u8"Исправление слабой чувствительности при зуме карты"] = {var = checkboxes.mapzoomfixer, cfg = "mapzoomfixer", fnc = "_"}, [u8"Исправление долгой загрузки карты в меню ESC"] = {var = checkboxes.fixloadmap, cfg = "fixloadmap", fnc = "FixLoadMap"}, [u8"Исправление крови при повреждении деревьев"] = {var = checkboxes.fixbloodwood, cfg = "fixbloodwood", fnc = "FixBloodWood"}, [u8"Исправление растянутых элементов игры"] = {var = checkboxes.ovalityCorrection, cfg = "ovalityCorrection", fnc = "OvalityCorrection"}, [u8"Исправление медленного плавания при большом FPS"] = {var = checkboxes.swimFix, cfg = "swimFix", fnc = "SwimFix"}, [u8"Исправление тряски кузова автомобилей"] = {var = checkboxes.swingingfix, cfg = "swingingfix", fnc = "SwingingFix"}, [u8"Исправление анимации приземления с парашютом"] = {var = checkboxes.paralandingfix, cfg = "paralandingfix", fnc = "_"}, [u8"Исправление рендера дождя под мостами"] = {var = checkboxes.FixUnderBridgeForRain, cfg = "FixUnderBridgeForRain", fnc = "FixUnderBridgeForRain"}, } local imguiCheckboxesBoostFPS = { [u8"Включить FPS unlock"] = {var = checkboxes.unlimitfps, cfg = "unlimitfps", fnc = "FPSUnlock"}, [u8"Скрыть ники игроков"] = {var = checkboxes.shownicks, cfg = "shownicks", fnc = "ShowNICKS"}, [u8"Скрыть хп игроков"] = {var = checkboxes.showhp, cfg = "showhp", fnc = "ShowHP"}, [u8"Скрыть 3D Text прикрепленный к игрокам"] = {var = checkboxes.no3dTextPlayers, cfg = "no3dTextPlayers", fnc = "_"}, [u8"Скрыть 3D Text прикрепленный к машинам"] = {var = checkboxes.no3dTextVehicles, cfg = "no3dTextVehicles", fnc = "_"}, } local imguiCheckboxesEffectsManagerSky = { [u8"Отключить низкие облака"] = {var = checkboxes.nocloudsmall, cfg = "nocloudsmall", fnc = "EffectsManager"}, [u8"Отключить высокие облака"] = {var = checkboxes.nocloudbig, cfg = "nocloudbig", fnc = "EffectsManager"}, [u8"Отключить облака на горизонте"] = {var = checkboxes.nocloudhorizont, cfg = "nocloudhorizont", fnc = "EffectsManager"}, [u8"Отключить птиц"] = {var = checkboxes.nobirds, cfg = "nobirds", fnc = "EffectsManager"}, [u8"Отключить молнию при дождливой погоде"] = {var = checkboxes.noWeatherFlash, cfg = "noweatherflash", fnc = "EffectsManager"}, [u8"Отключить густой туман при дожде"] = {var = checkboxes.noRainyFog, cfg = "noRainyFog", fnc = "EffectsManager"}, } local imguiCheckboxesEffectsManagerOther = { [u8"Отключить пост-обработку"] = {var = checkboxes.postfx, cfg = "postfx", fnc = "EffectsManager"}, [u8"Отключить дым из труб"] = {var = checkboxes.nofxsystem, cfg = "nofxsystem", fnc = "EffectsManager"}, [u8"Отключить кровь"] = {var = checkboxes.noblood, cfg = "noblood", fnc = "EffectsManager"}, [u8"Отключить следы ног на песке"] = {var = checkboxes.footprints, cfg = "footprints", fnc = "EffectsManager"}, [u8"Отключить эффекты воды"] = {var = checkboxes.swim, cfg = "swim", fnc = "EffectsManager"}, [u8"Отключить туман над водой"] = {var = checkboxes.nowaterfog, cfg = "nowaterfog", fnc = "EffectsManager"}, [u8"Отключить пыль при ходьбе"] = {var = checkboxes.footdust, cfg = "footdust", fnc = "EffectsManager"}, [u8"Отключить пыль при поломке объектов"] = {var = checkboxes.breakobject, cfg = "breakobject", fnc = "EffectsManager"}, [u8"Отключить эффект жары"] = {var = checkboxes.nomorehaze, cfg = "nomorehaze", fnc = "EffectsManager"}, [u8"Отключить блики на воде"] = {var = checkboxes.reflectionwater, cfg = "reflectionwater", fnc = "EffectsManager"}, [u8"Отключить огонь"] = {var = checkboxes.fireworld, cfg = "fireworld", fnc = "EffectsManager"}, [u8"Отключить точечный свет"] = {var = checkboxes.noPointLight, cfg = "noPointLight", fnc = "EffectsManager"}, } local imguiCheckboxesVehicleEffectsManager = { [u8"Отключить песок из под колес"] = {var = checkboxes.wheelsand, cfg = "wheelsand", fnc = "EffectsManager"}, [u8"Отключить пыль из под колес"] = {var = checkboxes.wheeldust, cfg = "wheeldust", fnc = "EffectsManager"}, [u8"Отключить грязь из под колес"] = {var = checkboxes.wheelmud, cfg = "wheelmud", fnc = "EffectsManager"}, [u8"Отключить гравий из под колес"] = {var = checkboxes.wheelgravel, cfg = "wheelgravel", fnc = "EffectsManager"}, [u8"Отключить траву из под колес"] = {var = checkboxes.wheelgrass, cfg = "wheelgrass", fnc = "EffectsManager"}, [u8"Отключить дым из под колес"] = {var = checkboxes.wheelspray, cfg = "wheelspray", fnc = "EffectsManager"}, [u8"Отключить искры при царапании"] = {var = checkboxes.vehsparks, cfg = "vehsparks", fnc = "EffectsManager"}, [u8"Отключить следы шин"] = {var = checkboxes.tiretracks, cfg = "tiretracks", fnc = "EffectsManager"}, [u8"Отключить дым из труб транспорта"] = {var = checkboxes.noexhaust, cfg = "noexhaust", fnc = "EffectsManager"}, [u8"Отключить дым от повреждения самолетов"] = {var = checkboxes.noSmokeCplane, cfg = "noSmokeCplane", fnc = "EffectsManager"}, [u8"Отключить полосы от самолетов на небе"] = {var = checkboxes.noplaneline, cfg = "noplaneline", fnc = "EffectsManager"}, [u8"Отключить свечение шашки такси"] = {var = checkboxes.vehtaxilight, cfg = "vehtaxilight", fnc = "EffectsManager"}, [u8"Отключить пыль от воздушного транспорта"] = {var = checkboxes.vehdust, cfg = "vehdust", fnc = "EffectsManager"}, [u8"Отключить пыль при столкновении"] = {var = checkboxes.vehdmgdust, cfg = "vehdmgdust", fnc = "EffectsManager"}, [u8"Отключить дым от поврежденного траспорта"] = {var = checkboxes.vehdmgsmoke, cfg = "vehdmgsmoke", fnc = "EffectsManager"}, [u8"Отключить отражения"] = {var = checkboxes.vehspec, cfg = "vehspec", fnc = "EffectsManager"}, } local imguiCheckboxesWeaponEffectsManager = { [u8"Отключить искры"] = {var = checkboxes.nosparks, cfg = "nosparks", fnc = "EffectsManager"}, [u8"Отключить огонь из оружия"] = {var = checkboxes.nogunfire, cfg = "nogunfire", fnc = "EffectsManager"}, [u8"Отключить дым из оружия"] = {var = checkboxes.nogunsmoke, cfg = "nogunsmoke", fnc = "EffectsManager"}, [u8"Отключить пыль при стрельбе в землю, песок"] = {var = checkboxes.nodust, cfg = "nodust", fnc = "EffectsManager"}, [u8"Отключить создание гильз при выстрелах"] = {var = checkboxes.gunshell, cfg = "gunshell", fnc = "EffectsManager"}, [u8"Отключить создание дыма от дымовой шашки"] = {var = checkboxes.teargas, cfg = "teargas", fnc = "EffectsManager"}, } ------------------- function __genOrderedIndex( t ) local orderedIndex = {} for key in pairs(t) do table.insert( orderedIndex, key ) end table.sort( orderedIndex ) return orderedIndex end function orderedNext(t, state) local key = nil if state == nil then t.__orderedIndex = __genOrderedIndex( t ) key = t.__orderedIndex[1] else for i = 1,table.getn(t.__orderedIndex) do if t.__orderedIndex[i] == state then key = t.__orderedIndex[i+1] end end end if key then return key, t[key] end t.__orderedIndex = nil return end function orderedPairs(t) return orderedNext, t, nil end ------------------ function LoadPatch() writeMemory(0x5B8E55, 4, 90000, true)--flickr writeMemory(0x5B8EB0, 4, 90000, true)--flickr local fVol = readMemory(0xEEFCEA, 4, true) writeMemory(0xB5FCC8, 4, fVol, true) writeMemory(0x5EFFE7, 1, 0xEB, true)-- disable talking ------------------------------------------------------------- writeMemory(0x5557CF, 4, 0x90909090, true)-- binthesky by DK writeMemory(0x5557CF+3, 4, 0x90909090, true) writeMemory(0x53E94C, 1, 0, true) --del fps delay 14 ms writeMemory(0x745BC9, 2, 0x9090, true) --SADisplayResolutions(1920x1080// 16:9) writeMemory(0xC2B9CC, 4, 0x3EB3B675, true)--car speed fps fix writeMemory(0x57733B, 4, 0x90909090, true)--Отключает действие на кнопку "Начать новую игру" в меню паузы writeMemory(0x57733B+4, 1, 0x90, true) ---disable input in framelimiter menu (пока не нужно) --writeMemory(0xBA6748+0x4C, 1, 0, true) --writeMemory(0x57CEC7,4, 0x0008C2, true) ------------------------------------------ end function onSystemInitialized() writeMemory(0xFDEAC5, 4, representFloatAsInt(readMemory(0xB6EC1C, 4, true)), true)--curr sens gotofunc("SetPriorityClass") local originalVol = representIntAsFloat(readMemory(0xB5FCC8, 4, true)) writeMemory(0xEEFCEA, 4, representFloatAsInt(originalVol), true) if originalVol < 0.0625 then writeMemory(0xB5FCC8, 4, representFloatAsInt(0.1000), true) end LoadPatch() end --====================================== | Timecyc Editor | ============================ local weather = { [0] = u8"ЭKCТPACOЛНEЧНAЯ LA", [1] = u8"COЛНEЧНAЯ LA", [2] = u8"ЭKCТPACOЛНEЧНAЯ CМOГ LA", [3] = u8"COЛНEЧНAЯ и CМOГ LA", [4] = u8"ВEТPEННAЯ LA", [5] = u8"COЛНEЧНAЯ SF", [6] = u8"ЭKCТPACOЛНEЧНAЯ SF", [7] = u8"OБЛAЧНAЯ SF", [8] = u8"ДOЖДЛИВAЯ SF", [9] = u8"ТYМAННAЯ SF", [10] = u8"COЛНEЧНAЯ VEGAS", [11] = u8"ЭKCТPACOЛНEЧНAЯ VEGAS", [12] = u8"OБЛAЧНAЯ VEGAS", [13] = u8"ЭKCТPACOЛНEЧНAЯ ЗAГOPOДНAЯ", [14] = u8"COЛНEЧНAЯ ЗAГOPOДНAЯ", [15] = u8"ВEТPEННAЯ ЗAГOPOДНAЯ", [16] = u8"ДOЖДЛИВAЯ ЗAГOPOДНAЯ", [17] = u8"ЭKCТPA COЛНEЧНAЯ ПYCТЫНЯ", [18] = u8"COЛНEЧНAЯ ПYCТЫНЯ", [19] = u8"БYPЯ в ПYCТЫНЕ", [20] = u8"ПOД ВOДOЙ", [21] = u8"ДOП. ЦВEТA 1", [22] = u8"ДOП. ЦВEТA 2" } local weatherchar = imgui.new['const char*'][#weather+1](weather) local CTimeCycle = {} local function getuint32(adr) return readMemory(adr, 4, true) end local function sampBase() return getModuleHandle("samp.dll") end function CTimeCycle_DATA() CTimeCycle.m_nAmbientRed = ffi.cast("unsigned char*", getuint32(0x560C61)) CTimeCycle.m_nAmbientGreen = ffi.cast("unsigned char*", getuint32(0x55F4D6)) CTimeCycle.m_nAmbientBlue = ffi.cast("unsigned char*", getuint32(0x55F4E8)) CTimeCycle.m_nAmbientRed_Obj = ffi.cast("unsigned char*", getuint32(0x55F4FA)) CTimeCycle.m_nAmbientGreen_Obj = ffi.cast("unsigned char*", getuint32(0x55F50C)) CTimeCycle.m_nAmbientBlue_Obj = ffi.cast("unsigned char*", getuint32(0x55F51E)) CTimeCycle.m_nSkyTopRed = ffi.cast("unsigned char*", getuint32(0x55F531)) CTimeCycle.m_nSkyTopGreen = ffi.cast("unsigned char*", getuint32(0x55F53D)) CTimeCycle.m_nSkyTopBlue = ffi.cast("unsigned char*", getuint32(0x55F549)) CTimeCycle.m_nSkyBottomRed = ffi.cast("unsigned char*", getuint32(0x55F555)) CTimeCycle.m_nSkyBottomGreen = ffi.cast("unsigned char*", getuint32(0x55F561)) CTimeCycle.m_nSkyBottomBlue = ffi.cast("unsigned char*", getuint32(0x55F56D)) CTimeCycle.m_nSunCoreRed = ffi.cast("unsigned char*", getuint32(0x55F579)) CTimeCycle.m_nSunCoreGreen = ffi.cast("unsigned char*", getuint32(0x55F585)) CTimeCycle.m_nSunCoreBlue = ffi.cast("unsigned char*", getuint32(0x55F591)) CTimeCycle.m_nSunCoronaRed = ffi.cast("unsigned char*", getuint32(0x55F59D)) CTimeCycle.m_nSunCoronaGreen = ffi.cast("unsigned char*", getuint32(0x55F5A9)) CTimeCycle.m_nSunCoronaBlue = ffi.cast("unsigned char*", getuint32(0x55F5B5)) CTimeCycle.m_fSunSize = ffi.cast("unsigned char*", getuint32(0x55F5C0)) CTimeCycle.m_fSpriteSize = ffi.cast("unsigned char*", getuint32(0x55F5D2)) CTimeCycle.m_fSpriteBrightness = ffi.cast("unsigned char*", getuint32(0x55F5E4)) CTimeCycle.m_nShadowStrength = ffi.cast("unsigned char*", getuint32(0x55F5F7)) CTimeCycle.m_nLightShadowStrength = ffi.cast("unsigned char*", getuint32(0x55F603)) CTimeCycle.m_nPoleShadowStrength = ffi.cast("unsigned char*", getuint32(0x55F60F)) CTimeCycle.m_fFarClip = ffi.cast("short*", getuint32(0x55F61B)) CTimeCycle.m_fFogStart = ffi.cast("short*", getuint32(0x55F62E)) CTimeCycle.m_fLightsOnGroundBrightness = ffi.cast("unsigned char*", getuint32(0x55F640)) CTimeCycle.m_nLowCloudsRed = ffi.cast("unsigned char*", getuint32(0x55F653)) CTimeCycle.m_nLowCloudsGreen = ffi.cast("unsigned char*", getuint32(0x55F65F)) CTimeCycle.m_nLowCloudsBlue = ffi.cast("unsigned char*", getuint32(0x55F66B)) CTimeCycle.m_nFluffyCloudsBottomRed = ffi.cast("unsigned char*", getuint32(0x55F677)) CTimeCycle.m_nFluffyCloudsBottomGreen = ffi.cast("unsigned char*", getuint32(0x55F683)) CTimeCycle.m_nFluffyCloudsBottomBlue = ffi.cast("unsigned char*", getuint32(0x55F690)) CTimeCycle.m_fWaterRed = ffi.cast("unsigned char*", getuint32(0x55F69C)) CTimeCycle.m_fWaterGreen = ffi.cast("unsigned char*", getuint32(0x55F6B0)) CTimeCycle.m_fWaterBlue = ffi.cast("unsigned char*", getuint32(0x55F6C3)) CTimeCycle.m_fWaterAlpha = ffi.cast("unsigned char*", getuint32(0x55F6D6)) CTimeCycle.m_fPostFx1Red = ffi.cast("unsigned char*", getuint32(0x55F6E9)) CTimeCycle.m_fPostFx1Green = ffi.cast("unsigned char*", getuint32(0x55F6FC)) CTimeCycle.m_fPostFx1Blue = ffi.cast("unsigned char*", getuint32(0x55F70F)) CTimeCycle.m_fPostFx1Alpha = ffi.cast("unsigned char*", getuint32(0x55F725)) CTimeCycle.m_fPostFx2Red = ffi.cast("unsigned char*", getuint32(0x55F73B)) CTimeCycle.m_fPostFx2Green = ffi.cast("unsigned char*", getuint32(0x55F751)) CTimeCycle.m_fPostFx2Blue = ffi.cast("unsigned char*", getuint32(0x55F767)) CTimeCycle.m_fPostFx2Alpha = ffi.cast("unsigned char*", getuint32(0x55F77D)) CTimeCycle.m_fCloudAlpha = ffi.cast("unsigned char*", getuint32(0x55F793)) CTimeCycle.m_nHighLightMinIntensity = ffi.cast("unsigned char*", getuint32(0x55F7A9)) CTimeCycle.m_nWaterFogAlpha = ffi.cast("unsigned char*", getuint32(0x55F7B8)) CTimeCycle.m_nDirectionalMult = ffi.cast("unsigned char*", getuint32(0x55F7C7)) CTimeCycle.Initialise = ffi.cast("void (__cdecl*)(void)", 0x5BBAC0) end CTimeCycle_DATA() CTimeCycle.Initialise() local CurrWeather = ffi.cast("short*", 0xC81320) local NextWeather = ffi.cast("short*", 0xC8131C) local Hours = ffi.cast("unsigned char*", 0xB70153) local Minutes = ffi.cast("unsigned char*", 0xB70152) local Seconds = ffi.cast("unsigned short*", 0xB70150) local TimeScale = ffi.cast("unsigned int*", 0xB7015C) local NUMWEATHERS = 23 local Im = { CurrWeather = new.int(CurrWeather[0]), NextWeather = new.int(NextWeather[0]), } ------------- [ custom genrl sounds ] ------------------ local workingDir = getWorkingDirectory() -- Основная директория для звуков оружия local soundDirectory = workingDir .. "\\GameTweaker\\GENRL\\" local customDirs = {} -- Таблица для хранения пользовательских директорий local folderName = "" local ImFolderName = new.char[128](folderName) local weapons = {} ----------------------------------------------------------- local isSpectator = 0 local spectatorPlayer = -1 local sp_handle = nil -- Функция для сохранения пользовательских директорий в файл function saveCustomDirs() local file = io.open(soundDirectory .. "customDirs.txt", "w") if file then for weaponId, folderName in pairs(customDirs) do file:write(weaponId .. "=" .. folderName .. "\n") end file:close() end end -- Функция для загрузки пользовательских директорий из файла function loadCustomDirs() local file = io.open(soundDirectory .. "customDirs.txt", "r") if file then for line in file:lines() do local weaponId, folderName = line:match("([^=]+)=([^=]+)") if weaponId and folderName then customDirs[tonumber(weaponId)] = folderName end end file:close() else customDirs = {} end end function addCustomFolder(folderName, weaponId) -- Проверяем, существует ли уже такая папка для указанного оружия if customDirs[weaponId] or doesDirectoryExist(soundDirectory .. "CUSTOMS\\" .. folderName) then for id, name in pairs(customDirs) do if id == weaponId then --print("{FF0000}Папка для оружия с ID " .. weaponId .. " уже существует: " .. name) AddNotify(script_name.." {FFFFFF}Папка для оружия с ID " .. weaponId .. " уже существует: " .. name, 5000, 520) return end if name == folderName then --print("{FF0000}Папка с названием " .. folderName .. " уже существует для оружия с ID " .. id) AddNotify(script_name.." {FFFFFF}Папка с названием " .. folderName .. " уже существует для оружия с ID " .. id, 5000, 520) return end end end -- Создаём новую папку, если её нет local customPath = soundDirectory .. "CUSTOMS\\" .. folderName if not doesDirectoryExist(customPath) then createDirectory(customPath) --print("{00FF00}Папка создана: " .. customPath) AddNotify(script_name.." {FFFFFF}Папка создана: " .. customPath, 5000, 520) end -- Обновляем таблицу пользовательских директорий customDirs[weaponId] = folderName -- Загружаем звуки из созданной папки local customSounds = getFilesFromDirectory(customPath) if #customSounds > 0 then -- Добавляем оружие с пользовательской папкой в таблицу `weapons` table.insert(weapons, { id = weaponId, name = folderName, sounds = customSounds, selected = 1, -- По умолчанию выбирается первый звук volume = config.ini.ugenrl_volume.weapon }) --print("{00FF00}Добавлена пользовательская папка для оружия ID: " .. weaponId) AddNotify(script_name.." {FFFFFF}Добавлена пользовательская папка для оружия ID: " .. weaponId, 5000, 520) else -- Если звуки отсутствуют, добавляем запись с предупреждением table.insert(weapons, { id = weaponId, name = folderName, sounds = {"Звук отсутствует"}, selected = 1, -- По умолчанию выбирается первый "звук" volume = config.ini.ugenrl_volume.weapon }) --print("{FF0000}Папка создана, но звуки не найдены.") AddNotify(script_name.." {FFFFFF}Папка создана, но звуки не найдены.", 5000, 520) end -- Сохраняем изменения в таблице пользовательских директорий saveCustomDirs() end -- Список оружия и соответствующих папок local weaponDirs = { Colt45 = "Colt-45", SDPistol = "SDPistol", Deagle = "Deagle", Shotgun = "Shotgun", CombatShotgun = "Combat-Shotgun", SawnoffShotgun = "Sawnoff-Shotgun", Rifle = "Rifle", M4 = "M4", MP5 = "MP5", Uzi = "Uzi", Minigun = "Minigun", Sniper = "Sniper", TEC9 = "TEC-9", AK = "AK-47", RPG = "RPG", Bell = "Bell", Pain = "Pain", Kill = "Kill", Explosion = "Explosion", Connected = "Connected", Disconnect = "Disconnected", OpenDialog = "OpenDialog", } -- Функция для получения всех файлов из директории function getFilesFromDirectory(directory) local files = {} for file in lfs.dir(directory) do if file ~= "." and file ~= ".." then table.insert(files, file) end end return files end -- Функция для загрузки звуков function loadSounds() colt45Sounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Colt45"]) sdpistolSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["SDPistol"]) deagleSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Deagle"]) shotgunSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Shotgun"]) rifleSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Rifle"]) m4Sounds = getFilesFromDirectory(soundDirectory .. weaponDirs["M4"]) mp5Sounds = getFilesFromDirectory(soundDirectory .. weaponDirs["MP5"]) uziSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Uzi"]) MinigunSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Minigun"]) AKSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["AK"]) hitSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Bell"]) painSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Pain"]) killSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Kill"]) explSounds = getFilesFromDirectory(soundDirectory .. weaponDirs["Explosion"]) connectedSound = getFilesFromDirectory(soundDirectory .. weaponDirs["Connected"]) disconnectSound = getFilesFromDirectory(soundDirectory .. weaponDirs["Disconnect"]) opendialogSound = getFilesFromDirectory(soundDirectory .. weaponDirs["OpenDialog"]) -- Загрузка кастомных звуков for weaponId, folderName in pairs(customDirs) do local customPath = soundDirectory .. "CUSTOMS\\" .. folderName if doesDirectoryExist(customPath) then local customSounds = getFilesFromDirectory(customPath) -- Проверяем, существует ли уже папка с таким weaponId local exists = false for _, weapon in ipairs(weapons) do if weapon.id == weaponId then exists = true break end end if not exists then if #customSounds > 0 then table.insert(weapons, { id = weaponId, name = folderName, sounds = customSounds, selected = 1, }) else table.insert(weapons, { id = weaponId, name = folderName, sounds = {"Звук отсутствует"}, selected = 1, }) end end end end end -- Загружаем пользовательские директории из файла loadCustomDirs() -- Загружаем звуки loadSounds() local selectedFolderToDelete = new.int(0) -- Для хранения выбранной папки local customDirsPath = "moonloader\\GameTweaker\\GENRL\\customDirs.txt" local customSoundsPath = "moonloader\\GameTweaker\\GENRL\\CUSTOMS\\" function getweaponname(weapon) local names = { [0] = "Fist", [1] = "Brass Knuckles", [2] = "Golf Club", [3] = "Nightstick", [4] = "Knife", [5] = "Baseball Bat", [6] = "Shovel", [7] = "Pool Cue", [8] = "Katana", [9] = "Chainsaw", [10] = "Purple Dildo", [11] = "Dildo", [12] = "Vibrator", [13] = "Silver Vibrator", [14] = "Flowers", [15] = "Cane", [16] = "Grenade", [17] = "Tear Gas", [18] = "Molotov Cocktail", [22] = "9mm", [23] = "Silenced 9mm", [24] = "Deagle", [25] = "Shotgun", [26] = "Sawnoff Shotgun", [27] = "Combat Shotgun", [28] = "Micro SMG/Uzi", [29] = "MP5", [30] = "AK-47", [31] = "M4", [32] = "Tec-9", [33] = "Rifle", [34] = "Sniper Rifle", [35] = "RPG", [36] = "HS Rocket", [37] = "Flamethrower", [38] = "Minigun", [39] = "Satchel Charge", [40] = "Detonator", [41] = "Spraycan", [42] = "Fire Extinguisher", [43] = "Camera", [44] = "Night Vis Goggles", [45] = "Thermal Goggles", [46] = "Parachute" } return names[weapon] or "Не определено" end -- Функция для чтения customDirs.txt function readCustomDirs() local dirs = {} if doesFileExist(customDirsPath) then local file = io.open(customDirsPath, "r") for line in file:lines() do local weaponId, folderName = line:match("(%d+)=(.+)") if weaponId and folderName then table.insert(dirs, { weaponId = tonumber(weaponId), folderName = folderName, weaponName = getweaponname(tonumber(weaponId)) or ("Оружие ID: " .. weaponId), path = customSoundsPath .. folderName -- Полный путь к папке с звуками }) end end file:close() end return dirs end readCustomDirs() -- Функция для открытия папки в проводнике Windows function openFolderInExplorer(folderPath) -- Заменяем слеши на обратные для Windows folderPath = folderPath:gsub("/", "\\") -- Проверяем существование папки if not doesDirectoryExist(folderPath) then AddNotify(script_name.." {FF0000}Ошибка: {FFFFFF}Папка не существует: "..folderPath, 5000, 520) return false end -- Открываем папку в проводнике local command = string.format('explorer "%s"', folderPath) os.execute(command) return true end -- Функция для удаления папки из customDirs.txt local function removeCustomDir(weaponId) if doesFileExist(customDirsPath) then local lines = {} local file = io.open(customDirsPath, "r") for line in file:lines() do local currentId = line:match("(%d+)=") if currentId and tonumber(currentId) ~= weaponId then table.insert(lines, line) end end file:close() file = io.open(customDirsPath, "w") for _, line in ipairs(lines) do file:write(line .. "\n") end file:close() end end -- Функция для удаления выбранной папки local function deleteSelectedFolder(selectedDir) if not selectedDir then return end -- Удаляем папку со звуками if doesDirectoryExist(selectedDir.path) then -- Удаляем все файлы в папке for file in lfs.dir(selectedDir.path) do if file ~= "." and file ~= ".." then os.remove(selectedDir.path .. "\\" .. file) end end -- Удаляем саму папку lfs.rmdir(selectedDir.path) end weapons = {} -- Удаляем запись из customDirs.txt removeCustomDir(selectedDir.weaponId) AddNotify(script_name.." {FFFFFF}Папка успешно удалена!", 5000, 520) addStdSounds() -- Загружаем пользовательские директории из файла loadCustomDirs() -- Загружаем звуки loadSounds() end function renderAddSounds() imgui.Text(u8"Гайд как добавить свои звуки:") imgui.BulletText(u8"Вы должны держать в руках оружие которому хотите добавить звук.") imgui.BulletText(u8"Введите название папки в поле ввода") imgui.BulletText(u8"Нажмите кнопку \"Создать\"") imgui.BulletText(u8"Сверните игру и перейдите в созданный каталог") imgui.BulletText(u8"Добавьте в созданную папку свои звуки формата .wav или .mp3") imgui.BulletText(u8"Вернитесь в игру и перезагрузите скрипты (CTRL+R)") imgui.BulletText(u8"Выберите понравившийся вам звук.") imgui.NewLine() local weaponId = getCurrentCharWeapon(PLAYER_PED) imgui.Text(u8"Добавить звук для оружия c ID: "..weaponId) imgui.NewLine() if imgui.BetterInput("##dss", u8"Название папки", ImFolderName, _, _, _) then folderName = u8:decode(ffi.string(ImFolderName)) end if imgui.Button(u8"Создать") then if weaponId and folderName ~= "" then addCustomFolder(folderName, weaponId) loadSounds() imgui.CloseCurrentPopup() else AddNotify(script_name.." {FF0000}Ошибка: {FFFFFF}Укажите название папки.", 5000, 520) end end imgui.SameLine() imgui.SetCursorPosX(imgui.GetCursorPos().x + 5) if imgui.Button(u8"Отмена") then imgui.CloseCurrentPopup() end imgui.SameLine() imgui.SetCursorPosX(imgui.GetCursorPos().x + 130) if imgui.Button(u8"Перейти в папку с кастом звуками", imgui.ImVec2(270, 22)) then openFolderInExplorer(customSoundsPath) end imgui.EndPopup() end -- Функция для отображения попапа удаления function showDeleteFolderPopup() imgui.Text(u8"Внимание! Это действие невозможно отменить!") imgui.Text(u8"Будет удалена папка со всеми звуками для выбранного оружия") -- Читаем список кастомных папок local customDirs = readCustomDirs() if #customDirs > 0 then -- Создаем список для Combo local folderList = {} for _, dir in ipairs(customDirs) do table.insert(folderList, string.format("%s (%s) - ID: %d", u8(dir.weaponName), u8(dir.folderName), dir.weaponId)) end -- Выбор папки для удаления if imgui.Combo("##Выбор папки", selectedFolderToDelete, imgui.new['const char*'][#folderList](folderList), #folderList) then -- selectedFolderToDelete уже обновлен автоматически end if imgui.Button(u8"Удалить") then deleteSelectedFolder(customDirs[selectedFolderToDelete[0] + 1]) imgui.CloseCurrentPopup() end else imgui.NewLine() imgui.Text(u8"Нет доступных кастомных звуков для удаления") end imgui.SameLine() if imgui.Button(u8"Отмена") then imgui.CloseCurrentPopup() end end -- Таблица с данными о звуках local weaponData = { {id = 24, name = "Deagle", sounds = deagleSounds, selected = selected_deagle, volume = config.ini.ugenrl_volume.weapon}, {id = 25, name = "Shotgun", sounds = shotgunSounds, selected = selected_shotgun, volume = config.ini.ugenrl_volume.weapon}, {id = 31, name = "M4", sounds = m4Sounds, selected = selected_m4, volume = config.ini.ugenrl_volume.weapon}, {id = 33, name = "Rifle", sounds = rifleSounds, selected = selected_rifle, volume = config.ini.ugenrl_volume.weapon}, {id = 29, name = "MP5", sounds = mp5Sounds, selected = selected_mp5, volume = config.ini.ugenrl_volume.weapon}, {id = 28, name = "UZI", sounds = uziSounds, selected = selected_uzi, volume = config.ini.ugenrl_volume.weapon}, {id = 23, name = "Silenced Pistol", sounds = sdpistolSounds, selected = selected_sdp, volume = config.ini.ugenrl_volume.weapon}, {id = 30, name = "AK-47", sounds = AKSounds, selected = selected_ak47, volume = config.ini.ugenrl_volume.weapon}, {id = 22, name = "Colt-45", sounds = colt45Sounds, selected = selected_colt45, volume = config.ini.ugenrl_volume.weapon}, {id = "hit", name = "Попадание", sounds = hitSounds, selected = selected_hit, volume = config.ini.ugenrl_volume.hit}, {id = "pain", name = "Боль", sounds = painSounds, selected = selected_pain, volume = config.ini.ugenrl_volume.pain}, {id = "kill", name = "Убийство", sounds = killSounds, selected = selected_kill, volume = config.ini.ugenrl_volume.kill} } function addStdSounds() -- Добавляем стандартные звуки в таблицу weapons for _, weapon in ipairs(weaponData) do table.insert(weapons, weapon) end end addStdSounds() -- Функция для смены звука function changeSound(id, name, vol) playSound(name, vol) config.ini.ugenrl_sounds[id] = name config.save() end -- Функция для получения номера звука function getNumberSounds(id, name) for i, v in ipairs(name) do if v == config.ini.ugenrl_sounds[id] then return i end end return false end function playSound(soundFile, soundVol, charHandle) local success, err = pcall(function() if not soundFile then return end local filePath = nil for _, folder in pairs(weaponDirs) do local possiblePath = soundDirectory .. folder .. "\\" .. soundFile if doesFileExist(possiblePath) then filePath = possiblePath break end end if filePath == nil or not doesFileExist(filePath) then print("Файл звука не существует: " .. (filePath or "Не определён")) return end if audio then collectgarbage() end if charHandle == nil then audio = loadAudioStream(filePath) else audio = load3dAudioStream(filePath) setPlay3dAudioStreamAtChar(audio, charHandle) end setAudioStreamVolume(audio, soundVol) setAudioStreamState(audio, 1) clearSound(audio) end) if not success then print("{FF0000}Ошибка при воспроизведении звука: " .. err) return false end return true end -- Функция для очистки звука function clearSound(audio) lua_thread.create(function() while getAudioStreamState(audio) == 1 do wait(50) end collectgarbage() end) end --=========================================| END | ===================================== local imagesLogo = {} local jpgFiles = {} function getJpgFilesInDirectory(directory) for filename in lfs.dir(directory) do -- Перебор файлов в директории if filename:match("logo.*.jpg$") then -- Проверка, соответствует ли файл нужному расширению table.insert(jpgFiles, filename) -- Добавление названия файла в таблицу end end return jpgFiles end local fonts = {} imgui.OnInitialize(function() imgui.GetIO().IniFilename = nil SwitchTheStyle() local config = imgui.ImFontConfig() config.MergeMode = true local glyph_ranges = imgui.GetIO().Fonts:GetGlyphRangesCyrillic() local path = getFolderPath(0x14) .. '\\arialbd.TTF' local iconRanges = new.ImWchar[3](fa.min_range, fa.max_range, 0) fonts[22] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 22, nil, glyph_ranges) fonts[18] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 17, nil, glyph_ranges) fonts[15] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 15, nil, glyph_ranges) fonts[17] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 17, nil, glyph_ranges) iconFont = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/GameTweaker/fonts/fa-solid-900.ttf', 18, config, iconRanges) --fone = imgui.CreateTextureFromFile(getGameDirectory() .. '\\moonloader\\GameTweaker\\fone.png') fonts[35] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 35, nil, glyph_ranges) fonts[50] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 50, nil, glyph_ranges) fonts[25] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 25, nil, glyph_ranges) fonts[28] = imgui.GetIO().Fonts:AddFontFromFileTTF(path, 28, nil, glyph_ranges) CTimeCycle_DATA() end) ------------------------------------------ [FFI cdef] --------------------------- ffi.cdef [[ int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect); void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long flAllocationType, unsigned long flProtect); int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType); int SetPriorityClass(void* hProcess, int dwPriorityClass); void* GetCurrentProcess(); typedef unsigned long HANDLE; typedef HANDLE HWND; typedef struct _RECT { long left; long top; long right; long bottom; } RECT, *PRECT; HWND GetActiveWindow(void); bool GetWindowRect( HWND hWnd, PRECT lpRect ); bool ClipCursor(const RECT *lpRect); bool GetClipCursor(PRECT lpRect); //---------------------- typedef unsigned int UINT; typedef unsigned long DWORD; typedef void* HANDLE; typedef DWORD HRESULT; typedef long LONG; typedef int BOOL; typedef enum _D3DFORMAT { __D3DFORMAT } D3DFORMAT; typedef enum _D3DMULTISAMPLE_TYPE { __D3DMULTISAMPLE_TYPE } D3DMULTISAMPLE_TYPE; typedef enum _D3DSWAPEFFECT { __D3DSWAPEFFECT } D3DSWAPEFFECT; typedef struct _HWND* HWND; typedef struct _IDirect3DDevice9 IDirect3DDevice9; void Sleep(unsigned long dwMilliseconds); typedef struct _RGNDATAHEADER { DWORD dwSize; DWORD iType; DWORD nCount; DWORD nRgnSize; RECT rcBound; } RGNDATAHEADER; typedef struct _RGNDATA { RGNDATAHEADER rdh; char Buffer[1]; } RGNDATA; typedef struct _D3DPRESENT_PARAMETERS { UINT BackBufferWidth; UINT BackBufferHeight; D3DFORMAT BackBufferFormat; UINT BackBufferCount; D3DMULTISAMPLE_TYPE MultiSampleType; DWORD MultiSampleQuality; D3DSWAPEFFECT SwapEffect; HWND hDeviceWindow; BOOL Windowed; BOOL EnableAutoDepthStencil; D3DFORMAT AutoDepthStencilFormat; DWORD Flags; UINT FullScreen_RefreshRateInHz; UINT PresentationInterval; } D3DPRESENT_PARAMETERS; typedef union _LARGE_INTEGER { struct { long LowPart; long HighPart; }; long long QuadPart; } LARGE_INTEGER; //kernel32 int __stdcall QueryPerformanceCounter(LARGE_INTEGER* performanceCount); int __stdcall QueryPerformanceFrequency(LARGE_INTEGER* frequency); //winmm DWORD __stdcall timeGetTime(void); typedef unsigned int uint16; typedef unsigned int uint8; ]] ------------------------------------------------------------------- local kernel32 = ffi.load("Kernel32.dll") local TARGET_FRAMERATE = 500 ------------------------------------------------------------------- local rcClip, rcOldClip = ffi.new('RECT'), ffi.new('RECT') ---------------------------------------------------------------------------------------- ------------------------------------ [cleaner] -------------------------------------------- local function round(num, idp) local mult = 10 ^ (idp or 0) return math.floor(num * mult + 0.5) / mult end function get_memory() return round(readMemory(0x8E4CB4, 4, true) / 1048576, 1) end ------------------------------------------------------------------------------------------------- local CWeather__ReleaseWeather = ffi.cast("void (__cdecl*)()", 0x72A510) local objdists = {} function isCharInAnyMotoBike(handle) local modelid = getCarModel(storeCarCharIsInNoSave(handle)) return modelid == 461 or modelid == 462 or modelid == 463 or modelid == 468 or modelid == 521 or modelid == 522 or modelid == 523 or modelid == 581 or modelid == 586 end function isCharInAnyBike(handle) local modelid = getCarModel(storeCarCharIsInNoSave(handle)) return modelid == 481 or modelid == 509 or modelid == 510 end ------------ local rkeys = {} function rkeys.getKeysName(keys) if type(keys) ~= "table" then print("[RKeys | getKeysName]: Bad argument #1. Value \"", tostring(keys), "\" is not table.") return false else local tKeysName = {} for k, v in ipairs(keys) do tKeysName[k] = vkeys.id_to_name(v) end return tKeysName end end function isWhMode() local NTwalls = sampGetServerSettingsPtr() return readMemory(NTwalls + 47, 1, true) == 0 and true or false end local nameTags = { getState = function() return readMemory(sampGetServerSettingsPtr() + 56, 1, true) end, setState = function(state) writeMemory(sampGetServerSettingsPtr() + 56, 1, state, true) end } local gameTextUsedServer = false local hideAcs = false local hiding_accessories = (function() local mod = {} local LocalPed = SCNetGame:RefNetGame():GetPlayerPool():GetLocalPlayer():GetPed() local ActiveCam = ffi.cast("uint8_t*", 0xB6F028 + 0x59) local function hideAccessories(BOOL) if LocalPed:HasAccessory() then local t = LocalPed.m_accessories for i = 0, 9 do if t.m_bNotEmpty[i] == 1 then local ent = ffi.cast("SCEntity*", t.m_pObject[i]).m_pGameEntity ent.bIsVisible = BOOL end end end end function mod.process() local mode = samem.camera.aCams[(ActiveCam[0])].nMode if mode == ffi.C.MODE_CAMERA or mode == ffi.C.MODE_SNIPER then if not hideAcs then hideAccessories(false) hideAcs = true end elseif hideAcs then hideAccessories(true) hideAcs = false end end return mod end) local changed = false local mouse_accel = (function() samem.require("CCamera") samem.require("CCam") samem.require("eCamMode") local nActiveCam = ffi.cast("uint8_t*", 0xB6F028 + 0x59) local pMenuData = 0xBA6748 local uMenuOpened = ffi.cast("uint8_t*", pMenuData + 0x15C) local uMenuSelect = ffi.cast("uint8_t*", pMenuData + 0x15D) local fMouseAccel = { ptr = { vertical = ffi.cast("float*", 0xB6EC1C), horzntle = ffi.cast("float*", 0xB6EC1C) }, org = { vertical = ffi.cast("float*", 0xB6EC1C)[0], horzntle = ffi.cast("float*", 0xB6EC1C)[0] } } local mod = { status = config.ini.settings.aisens, camera = config.ini.settings.camera, aiming = config.ini.settings.aiming, sniper = config.ini.settings.aimingSniper, } function mod:process() if mod.status then if uMenuOpened[0] == 1 and uMenuSelect[0] == 39 then if not changed then mod:uninit() changed = true end else if changed then changed = false mod:init() end local mode = samem.camera.aCams[(nActiveCam[0])].nMode local boost = representIntAsFloat(readMemory(0xFDEAC5, 4, true)) if mode == ffi.C.MODE_SNIPER or mode == ffi.C.MODE_ROCKETLAUNCHER or mode == ffi.C.MODE_ROCKETLAUNCHER_HS or mode == ffi.C.MODE_CAMERA then boost = mod.sniper elseif mode == ffi.C.MODE_AIMING or mode == ffi.C.MODE_AIMWEAPON or mode == ffi.C.MODE_AIMWEAPON_ATTACHED then boost = mod.aiming else boost = mod.camera end fMouseAccel.ptr.vertical[0] = boost / 1000 fMouseAccel.ptr.horzntle[0] = boost / 1000 end end end function mod:init() fMouseAccel.org.vertical = fMouseAccel.ptr.vertical[0] fMouseAccel.org.horzntle = fMouseAccel.ptr.horzntle[0] end function mod:uninit() fMouseAccel.ptr.vertical[0] = representIntAsFloat(readMemory(0xFDEAC5, 4, true)) fMouseAccel.ptr.horzntle[0] = representIntAsFloat(readMemory(0xFDEAC5, 4, true)) config.ini.settings.aisens = false config.save() checkboxes.aisens[0] = config.ini.settings.aisens AddNotify(script_name.."{FFFFFF} Функция {88aa62}Ai-Sens {dc4747}отключена {FFFFFF}т.к вы изменили чувствительность мыши через меню игры.", 5000, 520) end return mod end) local isSamp = false function main() --------------------- [ dual monitor fix] -------------- ffi.C.GetWindowRect(ffi.C.GetActiveWindow(), rcClip); ffi.C.ClipCursor(rcClip); -------------------------------------------------------- while not isSampAvailable() do wait(0) end isSamp = true CTimeCycle_DATA() getobjdists() if ffi.string(buffers.multilineText) == "" then buffers.multilineText = new.char[100000](u8(table.concat(objdists, "\n"))) end openMenuKeys = hotkey.RegisterHotKey('openMenu', false, decodeJson(config.ini.settings.openmenukeys), function() if not sampIsCursorActive() then UI.main[0] = not UI.main[0] end end) gotofunc("all")--load all funcs if getModuleHandle("timecycle24.asi") ~= 0 or getModuleHandle("timecycle24") ~= 0 then NUMHOURS = 24 bTimecyc24h = true else NUMHOURS = 8 bTimecyc24h = false end cntfont() lua_thread.create(Ugenrl) while true do wait(0) if config.ini.settings.sightObjectsFix then hiding_accessories():process() end if config.ini.settings.paralandingfix and isCharPlayingAnim(PLAYER_PED, "FALL_front") and getCurrentCharWeapon(PLAYER_PED) == 46 then taskPlayAnimNonInterruptable(PLAYER_PED, "PARA_LAND", "PARACHUTE", 10.0, 0, 0, 0, 0, -2) wait(1680) clearCharTasksImmediately(PLAYER_PED) end if not sampIsCursorActive() then if config.ini.settings.chatt and isKeyJustPressed(84) then sampSetChatInputEnabled(true) end end if isKeyJustPressed(72) and isCharInAnyPoliceVehicle(PLAYER_PED) then if isCarSirenOn(storeCarCharIsInNoSave(PLAYER_PED)) then switchCarSiren(storeCarCharIsInNoSave(PLAYER_PED), false) else switchCarSiren(storeCarCharIsInNoSave(PLAYER_PED), true) end end if config.ini.settings.aisens then mouse_accel():process() end if config.ini.settings.givemedist then if isCharInAnyPlane(PLAYER_PED) or isCharInAnyHeli(PLAYER_PED) then --airveh dist if memory_getfloat(0xB7C7F0, true) ~= config.ini.settings.drawdistair then memory_setfloat(0xB7C7F0, config.ini.settings.drawdistair, true) memory_setfloat(0xC992F0, config.ini.settings.fog, true) end else if memory_getfloat(0xB7C7F0, true) ~= config.ini.settings.drawdist and getCurrentCharWeapon(PLAYER_PED) ~= 46 then memory_setfloat(0xB7C7F0, config.ini.settings.drawdist, true) memory_setfloat(0xC992F0, config.ini.settings.fog, true) end if tonumber(("%.1f"):format(memory_getfloat(0xB7C7F0, true))) ~= config.ini.settings.drawdistpara and getCurrentCharWeapon(PLAYER_PED) == 46 then memory_setfloat(0xB7C7F0, config.ini.settings.drawdistpara, true) end end if memory_getfloat(0xC992F0, true) >= memory_getfloat(0xB7C7F0, true) then --fix bug dist memory_setfloat(0xC992F0, config.ini.settings.drawdist - 1.0, true) config.ini.settings.fog = config.ini.settings.drawdist - 1.0 config.save() end end --fix bug photograph if getCurrentCharWeapon(PLAYER_PED) == 43 and readMemory(0x70476E, 4, true) == 2866 and readMemory(0x53E227, 1, true) ~= 233 then writeMemory(0x53E227, 1, 0xE9, true) elseif getCurrentCharWeapon(PLAYER_PED) ~= 43 and readMemory(0x53E227, 1, true) ~= 195 and readMemory(0x70476E, 4, true) == 2866 then writeMemory(0x53E227, 1, 0xC3, true) end --fix bug photograph if preset["Clock"]["DrawClock"] and preset["Clock"]["PcClock"] then currentTime = os.date("*t") if preset["Clock"]["DrawSec"] then -- Формат "ЧЧ:ММ:СС" (с секундами) timeString = string.format("%02d:%02d:%02d", currentTime.hour, currentTime.min, currentTime.sec) else -- Формат "ЧЧ:ММ" (без секунд) timeString = string.format("%02d:%02d", currentTime.hour, currentTime.min) end memory.copy(0xCDA772, memory.strptr(timeString), 10, true) end if config.ini.settings.vehCameraTweak then if isCharInAnyCar(PLAYER_PED) then local car = storeCarCharIsInNoSave(PLAYER_PED) local modelId = getCarModel(car) setVehicleCameraTweak(modelId, 1.0, 1.0, 0.09) end end if config.ini.cleaner.autoclean then if tonumber(get_memory()) > tonumber(config.ini.cleaner.limit) then gotofunc("CleanMemory") end end if config.ini.settings.sync_time and not config.ini.settings.gtatime then if readMemory(0xB70153, 1, true) ~= os.date("%H") then config.ini.settings.hours = os.date("%H") gotofunc("SetTime") end if readMemory(0xB70152, 1, true) ~= os.date("%M") then config.ini.settings.min = os.date("%M") gotofunc("SetTime") end end if not config.ini.settings.sync_time and not config.ini.settings.gtatime and not config.ini.settings.gtaweather then if config.ini.settings.blockweather == true and readMemory(0xC81320, 2, true) ~= config.ini.settings.weather then gotofunc("SetWeather") end if config.ini.settings.blocktime == true and readMemory(0xB70153, 1, true) ~= config.ini.settings.hours then gotofunc("SetTime") end end if config.ini.settings.antiblockedplayer and not isCharInAnyCar(PLAYER_PED) then for i = 0, sampGetMaxPlayerId(true) do if sampIsPlayerConnected(i) then local result, id = sampGetCharHandleBySampPlayerId(i) if result then if doesCharExist(id) then local x, y, z = getCharCoordinates(id) local mX, mY, mZ = getCharCoordinates(PLAYER_PED) if 0.70 > getDistanceBetweenCoords3d(x, y, z, mX, mY, mZ) then setCharCollision(id, false) end end end end end end end end function wrapText(text, maxWidth, font) local words = {} for word in string.gmatch(text, "%S+") do table.insert(words, word) end local lines = {} local currentLine = words[1] for i = 2, #words do local word = words[i] local testLine = currentLine .. " " .. word if renderGetFontDrawTextLength(font, testLine) > maxWidth then table.insert(lines, currentLine) currentLine = word else currentLine = testLine end end table.insert(lines, currentLine) return lines end local CustomNameTagsPatch = getWorkingDirectory() .. "/GameTweaker/CustomNameTags" -- Таблица с текстурами local renderTextures = {} -- Загрузка текстур для оружий for i = 0, 255 do local texturePath = string.format("%s\\%d.png", CustomNameTagsPatch, i) if doesFileExist(texturePath) then renderTextures[i] = renderLoadTextureFromFile(texturePath) end end -- Таблица с именами дополнительных текстур local specialTextures = {"afk", "heart", "shield"} -- Загрузка дополнительных текстур for _, name in ipairs(specialTextures) do local texturePath = string.format("%s\\%s.png", CustomNameTagsPatch, name) if doesFileExist(texturePath) then renderTextures[name] = renderLoadTextureFromFile(texturePath) end end local function isSpec() local reC, pHandle = sampGetCharHandleBySampPlayerId(spectatorPlayer) return reC and pHandle or PLAYER_PED end local adjustedZ function Render() if isLookingAtPlayer() and not gameTextUsedServer then DrawIndicators() end if config.ini.custom_nametags.status then if nameTags.getState() then nameTags.setState(false) end local players = {} for i = 0, sampGetMaxPlayerId(true) do if sampIsPlayerConnected(i) then local getted, remotePlayer = sampGetCharHandleBySampPlayerId(i) if getted then if isCharOnScreen(remotePlayer) then -- Получаем координаты игрока local remotePlayerX, remotePlayerY, remotePlayerZ = getBodyPartCoordinates(8, remotePlayer) -- Используем текущие координаты if doesCharExist(isSpec()) then sp_handle = isSpec() end local myPosX, myPosY, myPosZ = getCharCoordinates(sp_handle or PLAYER_PED) local dist = getDistanceBetweenCoords3d(remotePlayerX, remotePlayerY, remotePlayerZ, myPosX, myPosY, myPosZ) local maxRenderDistance = tonumber(config.ini.settings.nickdistance) if isWhMode() then maxRenderDistance = 300 end if dist <= (isWhMode() and maxRenderDistance or representIntAsFloat(readMemory(0xFFFC90, 4, true))) and not isGamePaused() then if dist <= maxRenderDistance then table.insert(players, { id = i, dist = dist, player = remotePlayer, remotePlayerX = remotePlayerX, remotePlayerY = remotePlayerY, remotePlayerZ = remotePlayerZ }) end end end end end end -- Сортировка игроков по расстоянию table.sort(players, function(a, b) return a.dist < b.dist end) local nickPositions = {} local hpBarPositions = {} -- Минимальный радиус по X и Y local minRadiusX = 90 local minRadiusY = 22.5 for _, player in ipairs(players) do local i = player.id local remotePlayer = player.player local remotePlayerX = player.remotePlayerX local remotePlayerY = player.remotePlayerY local remotePlayerZ = player.remotePlayerZ local camX, camY, camZ = getActiveCameraCoordinates() -- Плавное изменение высоты ника в зависимости от расстояния local minHeight = 0.50 -- Минимальная высота (близко) local maxHeight = 5.0 -- Максимальная высота (далеко) local transitionDistance = 200 -- Расстояние, на котором достигается максимальная высота -- Интерполяция высоты между minHeight и maxHeight local heightFactor = math.min(3, player.dist / transitionDistance) adjustedZ = remotePlayerZ + minHeight + (maxHeight - minHeight) * heightFactor local wposX, wposY = convert3DCoordsToScreen(remotePlayerX, remotePlayerY, adjustedZ) local result, colPoint = processLineOfSight(camX, camY, camZ, remotePlayerX, remotePlayerY, remotePlayerZ, true, false, false, true, false, false, false, true) -- Получение разрешения экрана local screenWidth, screenHeight = getScreenResolution() -- Процент ширины экрана для определения смещения local viewOffsetPercentage = isWhMode() and 0.0 or 0.120 local viewOffset = math.floor(screenWidth * viewOffsetPercentage) -- Установка границ по X local minViewX = viewOffset local maxViewX = screenWidth - viewOffset if wposX >= minViewX and wposX <= maxViewX then if not result or isWhMode() then -- Получение цвета игрока и ника local color = sampGetPlayerColor(i) local aa, rr, gg, bb = explode_argb(color) color = join_argb(255, rr, gg, bb) local idColor = config.ini.custom_nametags.whiteId and "{FFFFFF}" or "" local playerColor = "{" .. bit.tohex(color) .. "}" local text = string.format("%s (%s%d%s)", sampGetPlayerNickname(i), idColor, i, playerColor) -- Отрисовка текста ника local nickTextWidth = renderGetFontDrawTextLength(CNTrenderFont, text) local nickHeight = renderGetFontDrawHeight(CNTrenderFont) -- Инициализация позиций фона, ников и баров local newNickPos = {x = wposX, y = wposY} local newHpBarPos = {x = wposX, y = wposY + nickHeight + 18} -- Проверка на пересечение с другими никами local isOverlapping = false for _, pos in ipairs(nickPositions) do if math.abs(newNickPos.x - pos.x) < minRadiusX and math.abs(newNickPos.y - pos.y) < minRadiusY then isOverlapping = true break end end -- Если пересечение, смещаем ник выше while isOverlapping do newNickPos.y = newNickPos.y - nickHeight newHpBarPos.y = newHpBarPos.y - nickHeight isOverlapping = false for _, pos in ipairs(nickPositions) do if math.abs(newNickPos.x - pos.x) < minRadiusX and math.abs(newNickPos.y - pos.y) < minRadiusY then isOverlapping = true break end end end table.insert(nickPositions, newNickPos) if not config.ini.settings.shownicks then if config.ini.custom_nametags.renderFon then -- Отрисовка фона для ника local backgroundColor = 0x63000000 renderDrawBox( newNickPos.x - nickTextWidth / 2 - 5, newNickPos.y - nickHeight / 2 + 4, nickTextWidth + 10, nickHeight + 5, backgroundColor ) end -- Отрисовка текста ника renderFontDrawText(CNTrenderFont, text, newNickPos.x - nickTextWidth / 2, newNickPos.y, color) end -- Отрисовка здоровья и брони if not config.ini.settings.showhp then local hpWidth = nickTextWidth + 6 local borderThickness = 1 local typebars = config.ini.custom_nametags.typebars local sizeYbars = 4 if typebars == 0 then -- обычный sizeYbars = 4 hpWidth = 40 elseif typebars == 1 then -- обычный + тоньше sizeYbars = 2.4 hpWidth = 40 elseif typebars == 2 then -- удлиненный sizeYbars = 4 hpWidth = 70 elseif typebars == 3 then -- удлиненный + тоньше sizeYbars = 2.4 hpWidth = 70 end if config.ini.custom_nametags.typebarsforma == 0 then -- Отрисовка брони перед здоровьем if sampGetPlayerArmor(i) > 0 then local armorY = newHpBarPos.y - sizeYbars - 5 -- Фон (обводка) для брони renderDrawBox( newHpBarPos.x - hpWidth / 2 - borderThickness, armorY - borderThickness, hpWidth + borderThickness * 2, sizeYbars + borderThickness * 2, preset["Recolorer"]["Recolorer"] and preset["Recolorer"]["PlayerArmor2"] or 0xFF000000 ) -- Основная полоса брони renderDrawBox( newHpBarPos.x - hpWidth / 2, armorY, sampGetPlayerArmor(i) / 100 * hpWidth, sizeYbars, preset["Recolorer"]["Recolorer"] and preset["Recolorer"]["PlayerArmor"] or 0xFFFFFFFF ) end -- Отрисовка здоровья local healthY = newHpBarPos.y if sampGetPlayerArmor(i) <= 0 then -- Если брони нет, здоровье отображается на месте брони healthY = newHpBarPos.y - sizeYbars - 5 end renderDrawBox( newHpBarPos.x - hpWidth / 2 - borderThickness, healthY - borderThickness, hpWidth + borderThickness * 2, sizeYbars + borderThickness * 2, preset["Recolorer"]["Recolorer"] and preset["Recolorer"]["PlayerHealth2"] or 0xFF000000 ) -- Основная полоса здоровья renderDrawBox( newHpBarPos.x - hpWidth / 2, healthY, math.clamp(sampGetPlayerHealth(i), 0, 100) / 100 * hpWidth, sizeYbars, preset["Recolorer"]["Recolorer"] and preset["Recolorer"]["PlayerHealth"] or 0xFFFF0000 ) elseif config.ini.custom_nametags.typebarsforma == 1 then -- Отрисовка иконок щита и сердца local heartIconX, heartIconY = sampGetPlayerArmor(i) > 0 and newHpBarPos.x - 60 or newHpBarPos.x - 30, newHpBarPos.y - 10 local shieldIconX, shieldIconY = newHpBarPos.x + 10, newHpBarPos.y - 10 -- Отрисовка иконки здоровья (сердце) renderDrawTexture(renderTextures["heart"], heartIconX, heartIconY, 30, 30, 0, 0xFFFFFFFF) renderFontDrawText( CNTrenderFont, tostring(math.clamp(sampGetPlayerHealth(i), 0, 100)), heartIconX + 35, heartIconY + 5, 0xFFFFFFFF ) -- Отрисовка иконки брони (щит), если броня > 0 if sampGetPlayerArmor(i) > 0 then renderDrawTexture(renderTextures["shield"], shieldIconX, shieldIconY, 30, 30, 0, 0xFFFFFFFF) renderFontDrawText( CNTrenderFont, tostring(math.clamp(sampGetPlayerArmor(i), 0, 100)), shieldIconX + 35, shieldIconY + 5, 0xFFFFFFFF ) end end end -- Отрисовка оружия local weaponId = getCurrentCharWeapon(remotePlayer) local texture = renderTextures[weaponId] if texture then local baseSize = 40 local scaleFactor = 0.488 local textureSize = {baseSize * scaleFactor, baseSize * scaleFactor} local backgroundColor = 0x60000000 local weaponIconX = newHpBarPos.x - textureSize[1] - (tonumber(config.ini.custom_nametags.typebars) > 1 and 50 or 35) local weaponIconY = (newHpBarPos.y + 5) - nickHeight / 2 - textureSize[2] / 2 if sampIsPlayerPaused(i) then if config.ini.custom_nametags.renderFon then renderDrawBox( weaponIconX - 3, weaponIconY - 3, textureSize[1] + 6, textureSize[2] + 6, backgroundColor ) end if config.ini.custom_nametags.renderWeapon then renderDrawTexture(renderTextures["afk"], weaponIconX, weaponIconY, textureSize[1], textureSize[2], 0, 0xFFFFFFFF) end else if config.ini.custom_nametags.renderWeapon then if config.ini.custom_nametags.renderFon then renderDrawBox( weaponIconX - 3, weaponIconY - 3, textureSize[1] + 6, textureSize[2] + 6, backgroundColor ) end renderDrawTexture(texture, weaponIconX, weaponIconY, textureSize[1], textureSize[2], 0, 0xFFFFFFFF) end end end end end end -- Обработка чат-баблов for k, v in pairs(chatBubbles) do if os.time() > v["time"] then table.remove(chatBubbles, k) else local getted, remotePlayer = sampGetCharHandleBySampPlayerId(v["playerid"]) if getted then if isCharOnScreen(remotePlayer) then -- Получаем координаты игрока local remotePlayerX, remotePlayerY, remotePlayerZ = getBodyPartCoordinates(8, remotePlayer) -- Используем текущие координаты if doesCharExist(isSpec()) then sp_handle = isSpec() end local myPosX, myPosY, myPosZ = getCharCoordinates(sp_handle or PLAYER_PED) local dist = getDistanceBetweenCoords3d(remotePlayerX, remotePlayerY, remotePlayerZ, myPosX, myPosY, myPosZ) if dist <= v["dist"] and not isGamePaused() then local camX, camY, camZ = getActiveCameraCoordinates() local wposX, wposY = convert3DCoordsToScreen(remotePlayerX, remotePlayerY, remotePlayerZ + 0.55 + (dist * 0.03)) local result, colPoint = processLineOfSight(camX, camY, camZ, remotePlayerX, remotePlayerY, remotePlayerZ, true, false, false, true, false, false, false, true) if not result then local rr, gg, bb, aa = explode_argb(v["color"]) local wrappedText = wrapText(v["text"], 300, CNTrenderFont) local startY = (wposY) - renderGetFontDrawHeight(CNTrenderFont) * #wrappedText for i, line in ipairs(wrappedText) do renderFontDrawText( CNTrenderFont, line, wposX - renderGetFontDrawTextLength(CNTrenderFont, line) / 2, startY + (i - 1) * renderGetFontDrawHeight(CNTrenderFont), join_argb(aa, rr, gg, bb) ) end end end end end end end end end function FrameLimiter() if config.ini.settings.framelimiter then if isPauseMenuActive() then TARGET_FRAMERATE = 999 else if isCharOnFoot(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.pedfps and not isCharSwimming(PLAYER_PED) and getCurrentCharWeapon(PLAYER_PED) ~= 34 and getCurrentCharWeapon(PLAYER_PED) ~= 41 then TARGET_FRAMERATE = config.ini.smart_fps.pedfps elseif isCharOnFoot(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.snipergunfps and not isCharSwimming(PLAYER_PED) and getCurrentCharWeapon(PLAYER_PED) == 34 then TARGET_FRAMERATE = config.ini.smart_fps.snipergunfps elseif isCharOnFoot(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.spraygunfps and not isCharSwimming(PLAYER_PED) and getCurrentCharWeapon(PLAYER_PED) == 41 then TARGET_FRAMERATE = config.ini.smart_fps.spraygunfps end if isCharInAnyHeli(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.helifps then TARGET_FRAMERATE = config.ini.smart_fps.helifps elseif isCharInAnyPlane(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.planefps then TARGET_FRAMERATE = config.ini.smart_fps.planefps elseif isCharInAnyCar(PLAYER_PED) and not isCharInAnyPlane(PLAYER_PED) and not isCharInAnyHeli(PLAYER_PED) and not isCharInAnyBoat(PLAYER_PED) then if isCharInAnyMotoBike(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.motofps then TARGET_FRAMERATE = config.ini.smart_fps.motofps end if isCharInAnyBike(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.bikefps then TARGET_FRAMERATE = config.ini.smart_fps.bikefps end if isCharSittingInAnyCar(PLAYER_PED) and not isCharInAnyPlane(PLAYER_PED) and not isCharInAnyHeli(PLAYER_PED) and not isCharInAnyMotoBike(PLAYER_PED) and not isCharInAnyBike(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.vehfps then TARGET_FRAMERATE = config.ini.smart_fps.vehfps end elseif isCharInAnyBoat(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.boatfps then TARGET_FRAMERATE = config.ini.smart_fps.boatfps elseif isCharSwimming(PLAYER_PED) and TARGET_FRAMERATE ~= config.ini.smart_fps.swimfps then TARGET_FRAMERATE = config.ini.smart_fps.swimfps end end end end local ffi = require("ffi") local kernel32 = ffi.load("kernel32.dll") local frequency_large = ffi.new("LARGE_INTEGER") kernel32.QueryPerformanceFrequency(frequency_large) local performance_frequency = tonumber(frequency_large.QuadPart) local function get_current_ms() local ticks_large = ffi.new("LARGE_INTEGER") kernel32.QueryPerformanceCounter(ticks_large) return tonumber(ticks_large.QuadPart) * (1000 / performance_frequency) end local function precise_sleep(ms) local start_time = get_current_ms() local end_time = start_time + ms local remaining_time = ms while remaining_time > 2 do kernel32.Sleep(1) remaining_time = end_time - get_current_ms() end while get_current_ms() < end_time do end end local _last_frame_time = 0 function onD3DPresent() if config.ini.settings.framelimiter then if TARGET_FRAMERATE >= 4 and TARGET_FRAMERATE <= 299 then local current_time = get_current_ms() if _last_frame_time ~= 0 then local time_elapsed = current_time - _last_frame_time local frame_time = 1000 / TARGET_FRAMERATE if time_elapsed < frame_time then precise_sleep(frame_time - time_elapsed) end end _last_frame_time = get_current_ms() end end if config.ini.settings.fastquit and readMemory(0xC17040 + 0x10, 1, true) == 1 then KillGTA() end if isSamp then Render() FrameLimiter() end end function KillGTA() ffi.cdef[[ int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId); int TerminateProcess(int hProcess, int uExitCode); int CloseHandle(int hObject); int GetCurrentProcessId(); ]] local hProcess = ffi.C.OpenProcess(0x0001, 0, ffi.C.GetCurrentProcessId()) if hProcess ~= 0 then ffi.C.TerminateProcess(hProcess, 0) ffi.C.CloseHandle(hProcess) end end function Ugenrl() while true do wait(0) if config.ini.ugenrl_main.enable and sampGetGamestate() == 3 then if config.ini.ugenrl_main.mode == 0 or config.ini.ugenrl_main.mode == 1 then if config.ini.ugenrl_main.weapon then if isCharShooting(PLAYER_PED) then playSound(config.ini.ugenrl_sounds[getCurrentCharWeapon(PLAYER_PED)], config.ini.ugenrl_volume.weapon) if weaponSoundDelayGuns[getCurrentCharWeapon(PLAYER_PED)] then wait(weaponSoundDelayGuns[getCurrentCharWeapon(PLAYER_PED)]) end end if config.ini.ugenrl_main.enemyWeapon then local myX, myY, myZ = getCharCoordinates(PLAYER_PED) repeat local hasFoundChars, randomCharHandle = findAllRandomCharsInSphere(myX, myY, myZ, config.ini.ugenrl_main.enemyWeaponDist, true, true) if hasFoundChars and hasFoundChars ~= nil and isCharShooting(randomCharHandle) then playSound(config.ini.ugenrl_sounds[getCurrentCharWeapon(randomCharHandle)], config.ini.ugenrl_volume.weapon + 0.20, randomCharHandle) if weaponSoundDelayGuns[getCurrentCharWeapon(randomCharHandle)] then wait(weaponSoundDelayGuns[getCurrentCharWeapon(randomCharHandle)]) end end until not hasFoundChars end end if playPain then playSound(config.ini.ugenrl_sounds.pain, config.ini.ugenrl_volume.pain) playPain = false if weaponSoundDelayPainAndHit[dmgWeaponId] then wait(weaponSoundDelayPainAndHit[dmgWeaponId]) end end end if playHit then playSound(config.ini.ugenrl_sounds.hit, config.ini.ugenrl_volume.hit) playHit = false if weaponSoundDelayPainAndHit[dmgWeaponId] then wait(weaponSoundDelayPainAndHit[dmgWeaponId]) end end if playKill then playSound(config.ini.ugenrl_sounds.kill, config.ini.ugenrl_volume.kill) playKill = false end end end end function onExitScript(quitGame) if quitGame and config.ini.settings.fastquit then KillGTA() end end function onWindowMessage(msg, wparam, lparam) if wparam == 27 then if UI.main[0] or UI.tws[0] or UI.tcyc[0] then if msg == wm.WM_KEYDOWN then consumeWindowMessage(true, false) elseif msg == wm.WM_KEYUP then if UI.main[0] then UI.main[0] = false elseif UI.tws[0] then UI.tws[0] = not UI.tws[0] elseif UI.tcyc[0] then UI.tcyc[0] = false end end end end if config.ini.settings.mapzoomfixer and msg == 522 and readMemory(0xBA68A5, 1, true) == 5 then local zoomLevel = memory_getfloat(0xBA67AC, true) if wparam == 7864320 and zoomLevel < 1000.0 then memory_setfloat(0xBA67AC, zoomLevel + 42.0, false) elseif wparam == 4287102976 and zoomLevel > 300.0 then memory_setfloat(0xBA67AC, zoomLevel - 42.0, false) end end if config.ini.settings.dual_monitor_fix then if msg == wm.WM_KILLFOCUS then ffi.C.GetClipCursor(rcOldClip) ffi.C.ClipCursor(rcOldClip) elseif msg == wm.WM_SETFOCUS then ffi.C.GetWindowRect(ffi.C.GetActiveWindow(), rcClip) ffi.C.ClipCursor(rcClip) end end if config.ini.nop_samp_keys.key_ALTENTER and msg == 261 and wparam == 13 then consumeWindowMessage(true, true) end end function displayCustomText(entryName, text, x, y, width, height, style, alignment, color) -- Установка выравнивания текста if alignment == 1 then setTextJustify(true) -- Левое выравнивание. elseif alignment == 2 then setTextCentre(true) -- Центральное выравнивание. elseif alignment == 3 then setTextRightJustify(true) -- Правое выравнивание. end local function explode_argb(argb) local a = bit.band(bit.rshift(argb, 24), 0xFF) local r = bit.band(bit.rshift(argb, 16), 0xFF) local g = bit.band(bit.rshift(argb, 8), 0xFF) local b = bit.band(argb, 0xFF) return r, g, b, a end -- Установка текста и параметров отображения setGxtEntry(entryName, text) -- entryName (Может быть любое название при вызове), текст. setTextScale(width, height) -- Ширина, высота. setTextColour(explode_argb(color)) -- Цвет в формате rgba. setTextEdge(1.0, 0, 0, 0, 255) -- Ширина обводки, цвет обводки. setTextFont(style) -- Стиль 0-3. setTextProportional(true) displayText(x, y, entryName) -- Позиция по оси x и y, и уже наш текст. end function isLookingAtPlayer() return readMemory(0xB6F028+0x2B, 1, true) == 1 end function DrawIndicators() local health = getCharHealth(PLAYER_PED) if preset["HPHud"]["Status"] and not sampIsScoreboardOpen() and readMemory(0xBA6769, 1, false) ~= 0 and readMemory(0xBA676C, 1, true) == 0 and health > 0 then if health > 999 then health = "999" end displayCustomText("hp", health.. (preset["HPHud"]["hptext"] and "_hp" or ""), preset["HPHud"]["posX"], preset["HPHud"]["posY"], preset["HPHud"]["sizeX"], preset["HPHud"]["sizeY"], preset["HPHud"]["fonts"], 1, preset["HPHud"]["Color"]) end local armour = getCharArmour(PLAYER_PED) if preset["ArmorHud"]["Status"] and not sampIsScoreboardOpen() and readMemory(0xBA6769, 1, false) ~= 0 and readMemory(0xBA676C, 1, true) == 0 and armour > 0 then if armour > 999 then armour = "999" end displayCustomText("ar", armour.. (preset["ArmorHud"]["armortext"] and "_ar" or ""), preset["ArmorHud"]["posX"], preset["ArmorHud"]["posY"], preset["ArmorHud"]["sizeX"], preset["ArmorHud"]["sizeY"], preset["ArmorHud"]["fonts"], 1, preset["ArmorHud"]["Color"]) end end function math.clamp(x, min, max) return math.max(math.min(x, max), min) end function getobjdists() local file = io.open("moonloader\\GameTweaker\\Objects_Dist.txt", "a+") -- открываем и создаем файл file:close() -- закрываем, это если не будет файла то он создатся. Да да это гениально! local file = io.open("moonloader\\GameTweaker\\Objects_Dist.txt", "a+") -- открываем for line in file:lines() do -- читаем его построчно objdists[#objdists+1] = line -- записываем строки в массив end file:close() -- закрываем файл end -- Функция для получения списка файлов с определенным расширением в указанной директории function getTxtFilesInDirectory(directory) for filename in lfs.dir(directory) do -- Перебор файлов в директории if filename:match("%.json$") then -- Проверка, соответствует ли файл нужному расширению table.insert(txtFiles, filename) -- Добавление названия файла в таблицу txtFiles end end return txtFiles end local txtFilesInCurrentDirectory = getTxtFilesInDirectory(getGameDirectory().."\\moonloader\\GameTweaker\\IE-presets") -- Получение списка файлов local selectedFile = 1 -- По умолчанию выбран первый файл function getSelect(id, name) for i, v in ipairs(name) do if v == id then n = i end end return n end local tempName local tempIter local col1 = imgui.ImVec4(config.ini.BeginColor.r, config.ini.BeginColor.g, config.ini.BeginColor.b, config.ini.BeginColor.a) local col2 = imgui.ImVec4(config.ini.ColorText.r, config.ini.ColorText.g, config.ini.ColorText.b, config.ini.ColorText.a) function drawFileSelection() imgui.MainBox("Пресеты", imgui.ImVec2(160,180), 0) imgui.PushFont(fonts[22]) imgui.PushStyleColor(imgui.Col.Text, col1) imgui.Text(u8"Пресеты") imgui.PopStyleColor() imgui.PopFont() imgui.Spacing() imgui.PushStyleColor(imgui.Col.Text, col2) for i, filename in pairs(txtFilesInCurrentDirectory) do imgui.PushFont(iconFont) if imgui.Button(fa.ICON_FA_TRASH.."##" .. i) and filename ~= "Standart.json" then tempName = filename tempIter = i imgui.OpenPopup(u8'Удаление пресета') end imgui.PopFont() imgui.SameLine() if selectedFile ~= getSelect(config.ini.settings.currentpreset, txtFilesInCurrentDirectory) then selectedFile = getSelect(config.ini.settings.currentpreset, txtFilesInCurrentDirectory) end if imgui.Selectable((string.gsub(u8(filename), ".json", "")), selectedFile == i) then selectedFile = i -- Обновление выбранного файла config.ini.settings.currentpreset = filename config.save() getJson() jsonExist(IEPresets) gotofunc("InterfaceElementEditor") gotofunc("Recolorer") imgui_Data() end end if imgui.BeginPopupModal(u8'Удаление пресета', nil, imgui.WindowFlags.NoResize) then imgui.Text(u8"Вы действительно хотите удалить "..u8:encode(tempName).." ?") imgui.SetCursorPosX(imgui.GetCursorPos().x + 60) if imgui.Button(u8"Удалить", imgui.ImVec2(90, 24)) and tempName ~= "Standart.json" then table.remove(txtFilesInCurrentDirectory, tempIter) -- Удаляем пресет из списка selectedFile = 0 -- Сбрасываем выбранный файл, так как он уже удален os.remove(getGameDirectory().."\\moonloader\\GameTweaker\\IE-presets\\"..tempName) imgui.CloseCurrentPopup() end imgui.SameLine() imgui.SetCursorPosX(imgui.GetCursorPos().x + 10) if imgui.Button(u8"Отмена", imgui.ImVec2(80, 24)) then imgui.CloseCurrentPopup() end imgui.EndPopup() end imgui.PopStyleColor() imgui.EndChild() end local navigations = { --====[[какая вкладка активна?]]====-- activeTab = { home = new.int(1), fixesandpatches = new.int(1), graphics = new.int(1), optimization = new.int(1), gameinterface = new.int(1), }, --===================================-- home = { fa.ICON_FA_HOME..u8'\tО системе', fa.ICON_FA_CHART_AREA..u8'\tОптимизация' --fa.ICON_FA_COG..u8"\tSettings", }, fixesandpatches = { u8"Исправления", u8"Патчи", }, current_fixesandpatches = 1, graphics = { u8'Погода и время', u8'Прорисовка', u8'Тени', u8'Эффекты', u8'Таймцикл', u8'Параметры экрана', }, current_graphics = 1, optimization = { u8'Ограничитель кадров' }, current_optimization = 1, gameinterface = { u8'Патроны', u8'Здоровье', u8'Деньги', u8'Радар', u8'Меню игры', u8'Прицел', u8'Кислород', u8'Броня', u8'Оружие', u8'Розыск', u8'Часы', }, sounds = { u8'Ultimate Genrl', u8'Game Sounds', u8'Interactive Audio', }, current_sounds = 1, interface_elemets = { u8"Элементы интерфейса", u8"Цвета элементов", u8"Индикаторы", u8"Пресеты", u8"Прочее", }, current_elemets = 1, } local twsrender = imgui.OnFrame( function() return UI.tws[0] end, function(gtw) gtw.HideCursor = not UI.tws[0] if isKeyDown(32) and gtw.HideCursor == false then gtw.HideCursor = true elseif not isKeyDown(32) and gtw.HideCursor == true and UI.tws[0] then gtw.HideCursor = false end imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5)) imgui.SetNextWindowSize(imgui.ImVec2(350, 140), imgui.Cond.FirstUseEver) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0.0, 0.0, 0.0, 1.0)) imgui.Begin(u8"Редактор погоды и времени", UI.tws, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoResize) imgui.Text(u8"Погода:") imgui.SameLine() imgui.SetCursorPosX(80) if imgui.CustomSlider(u8"##Weather", sliders.weather, 0, 45, u8"", 230) then config.ini.settings.weather = sliders.weather[0] config.save() gotofunc("SetWeather") end imgui.SameLine() imgui.PushItemWidth(25) if imgui.InputInt(u8"##Weather_input", sliders.weather, 0, 45) then if sliders.weather[0] < 0 then sliders.weather[0] = 0 end if sliders.weather[0] > 45 then sliders.weather[0] = 45 end config.ini.settings.weather = sliders.weather[0] config.save() gotofunc("SetWeather") end imgui.PopItemWidth() imgui.Text(u8"Часы:") imgui.SameLine() imgui.SetCursorPosX(80) if imgui.CustomSlider(u8"##hours", sliders.hours, 0, 23, u8"", 230) then config.ini.settings.hours = sliders.hours[0] config.save() gotofunc("SetTime") end imgui.SameLine() imgui.PushItemWidth(25) if imgui.InputInt(u8"##hours_input", sliders.hours, 0, 23) then if sliders.hours[0] < 0 then sliders.hours[0] = 0 end if sliders.hours[0] > 23 then sliders.hours[0] = 23 end config.ini.settings.hours = sliders.hours[0] config.save() gotofunc("SetTime") end imgui.PopItemWidth() imgui.Text(u8"Минуты:") imgui.SameLine() imgui.SetCursorPosX(80) if imgui.CustomSlider(u8"##min", sliders.min, 0, 59, u8"", 230) then config.ini.settings.min = sliders.min[0] config.save() gotofunc("SetTime") end imgui.SameLine() imgui.PushItemWidth(25) if imgui.InputInt(u8"##min_input", sliders.min, 0, 59) then if sliders.min[0] < 0 then sliders.min[0] = 0 end if sliders.min[0] > 59 then sliders.min[0] = 59 end config.ini.settings.min = sliders.min[0] config.save() gotofunc("SetTime") end imgui.PopItemWidth() if imgui.Checkbox(u8"Блокировать изменение погоды сервером", checkboxes.blockweather) then config.ini.settings.blockweather = checkboxes.blockweather[0] config.save() gotofunc("BlockWeather") gotofunc("SetWeather") end if imgui.Checkbox(u8"Блокировать изменение времени сервером", checkboxes.blocktime) then config.ini.settings.blocktime = checkboxes.blocktime[0] config.save() gotofunc("BlockTime") gotofunc("SetTime") end imgui.PopStyleColor() imgui.End() end ) local timecyc_creator_render = imgui.OnFrame( function() return UI.tcyc[0] end, function(tself) tself.HideCursor = not UI.tcyc[0] if isKeyDown(32) and tself.HideCursor == false then tself.HideCursor = true elseif not isKeyDown(32) and tself.HideCursor == true and UI.tcyc[0] then tself.HideCursor = false end imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5)) imgui.SetNextWindowSize(imgui.ImVec2(660, 700), imgui.Cond.FirstUseEver) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0.0, 0.0, 0.0, 1.0)) imgui.Begin(u8"Редактор таймцикла", UI.tcyc) imgui.PushFont(fonts[18]) if not config.ini.settings.blocktime or not config.ini.settings.blockweather then imgui.Text(u8"Функция не доступна на данный момент.\nВключите блокировку погоды и времени.") else if config.ini.settings.gtatime or config.ini.settings.sync_time or config.ini.settings.gtaweather then imgui.Text(u8"Функция не доступна на данный момент.\nОтключите цикл времени и погоды, синхронизацию игрового времени с ПК.") elseif config.ini.fixtimecyc.active then imgui.Text(u8"Отключите исправление таймцикла!") if imgui.Checkbox(u8"Настройка таймцикла для выключенной пост-обработки", checkboxes.fixtimecyc) then config.ini.fixtimecyc.active = checkboxes.fixtimecyc[0] config.save() gotofunc("FixTimecyc") end else if imgui.Button(u8"Сбросить таймцикл") then CTimeCycle.Initialise() end imgui.NewLine() Im_Update() imgui.PushItemWidth(400) local i = NUMWEATHERS * CTimeCycle.GetCurrentHourTimeId() + CurrWeather[0] CurrWeather[0] = Im.CurrWeather[0] NextWeather[0] = Im.NextWeather[0] if imgui.Combo(u8"Текущая погода", Im.CurrWeather, weatherchar, #weather) then CurrWeather[0] = Im.CurrWeather[0] config.ini.settings.weather = Im.CurrWeather[0] config.save() end if imgui.Combo(u8"Следующая погода", Im.NextWeather, weatherchar, #weather) then NextWeather[0] = Im.NextWeather[0] end if imgui.SliderInt(u8"Часы", sliders.hours, 0, 23, "%.0f") then config.ini.settings.hours = sliders.hours[0] config.save() gotofunc("SetTime") end if imgui.SliderInt(u8"Минуты", sliders.min, 0, 59, "%.0f") then config.ini.settings.min = sliders.min[0] config.save() gotofunc("SetTime") end if imgui.ColorEdit3(u8"Окружение", Im.AmbRGB) then CTimeCycle.m_nAmbientRed[i], CTimeCycle.m_nAmbientGreen[i], CTimeCycle.m_nAmbientBlue[i] = Im.AmbRGB[0] * 255, Im.AmbRGB[1] * 255, Im.AmbRGB[2] * 255 end if imgui.ColorEdit3(u8"Освещение динам. объектов", Im.AmbObjRGB) then CTimeCycle.m_nAmbientRed_Obj[i], CTimeCycle.m_nAmbientGreen_Obj[i], CTimeCycle.m_nAmbientBlue_Obj[i] = Im.AmbObjRGB[0] * 255, Im.AmbObjRGB[1] * 255, Im.AmbObjRGB[2] * 255 end if imgui.ColorEdit3(u8"Небо верх", Im.SkyTopRGB) then CTimeCycle.m_nSkyTopRed[i], CTimeCycle.m_nSkyTopGreen[i], CTimeCycle.m_nSkyTopBlue[i] = Im.SkyTopRGB[0] * 255, Im.SkyTopRGB[1] * 255, Im.SkyTopRGB[2] * 255 end if imgui.ColorEdit3(u8"Небо низ", Im.SkyBottomRGB) then CTimeCycle.m_nSkyBottomRed[i], CTimeCycle.m_nSkyBottomGreen[i], CTimeCycle.m_nSkyBottomBlue[i] = Im.SkyBottomRGB[0] * 255, Im.SkyBottomRGB[1] * 255, Im.SkyBottomRGB[2] * 255 end if imgui.ColorEdit3(u8"Солнечный диск", Im.SunCoreRGB) then CTimeCycle.m_nSunCoreRed[i], CTimeCycle.m_nSunCoreGreen[i], CTimeCycle.m_nSunCoreBlue[i] = Im.SunCoreRGB[0] * 255, Im.SunCoreRGB[1] * 255, Im.SunCoreRGB[2] * 255 end if imgui.ColorEdit3(u8"Солнечная корона", Im.SunCoronaRGB) then CTimeCycle.m_nSunCoronaRed[i], CTimeCycle.m_nSunCoronaGreen[i], CTimeCycle.m_nSunCoronaBlue[i] = Im.SunCoronaRGB[0] * 255, Im.SunCoronaRGB[1] * 255, Im.SunCoronaRGB[2] * 255 end if imgui.SliderInt(u8"Размер солнца", Im.SunSz, 0, 127) then CTimeCycle.m_fSunSize[i] = Im.SunSz[0] end if imgui.SliderInt(u8"Размер спрайта", Im.SpriteSz, 0, 127) then CTimeCycle.m_fSpriteSize[i] = Im.SpriteSz[0] end if imgui.InputInt(u8"Яркость спрайта", Im.SpriteBrght, 1, 10) then CTimeCycle.m_fSpriteBrightness[i] = Im.SpriteBrght[0] end if imgui.SliderInt(u8"Настройки теней", Im.ShadowStr, 0, 255) then CTimeCycle.m_nShadowStrength[i] = Im.ShadowStr[0] end if imgui.SliderInt(u8"Четкость краев теней", Im.PoleShadowStr, 0, 255) then CTimeCycle.m_nPoleShadowStrength[i] = Im.PoleShadowStr[0] end if imgui.SliderInt(u8"Сила освещения от объектов", Im.LightShadowStrength, 0, 255) then CTimeCycle.m_nLightShadowStrength[i] = Im.LightShadowStrength[0] end if imgui.InputInt(u8"Расстояние до объектов", Im.FarClip, 1, 10) then CTimeCycle.m_fFarClip[i] = Im.FarClip[0] end if imgui.InputInt(u8"Расстояние до тумана", Im.FogStart, 1, 10) then CTimeCycle.m_fFogStart[i] = Im.FogStart[0] end if imgui.SliderInt(u8"Яркость света на земле", Im.LightsOnGroundBrightness, 0, 255) then CTimeCycle.m_fLightsOnGroundBrightness[i] = Im.LightsOnGroundBrightness[0] end if imgui.ColorEdit3(u8"Нижние облака", Im.LowCloudsRGB) then CTimeCycle.m_nLowCloudsRed[i], CTimeCycle.m_nLowCloudsGreen[i], CTimeCycle.m_nLowCloudsBlue[i] = Im.LowCloudsRGB[0] * 255, Im.LowCloudsRGB[1] * 255, Im.LowCloudsRGB[2] * 255 end if imgui.ColorEdit3(u8"Верхние облака", Im.FluffyCloudsBotttomRGB) then CTimeCycle.m_nFluffyCloudsBottomRed[i], CTimeCycle.m_nFluffyCloudsBottomGreen[i], CTimeCycle.m_nFluffyCloudsBottomBlue[i] = Im.FluffyCloudsBotttomRGB[0] * 255, Im.FluffyCloudsBotttomRGB[1] * 255, Im.FluffyCloudsBotttomRGB[2] * 255 end if imgui.ColorEdit4(u8"Вода", Im.WaterRGBA, imgui.ColorEditFlags.AlphaBar) then CTimeCycle.m_fWaterRed[i], CTimeCycle.m_fWaterGreen[i], CTimeCycle.m_fWaterBlue[i], CTimeCycle.m_fWaterAlpha[i] = Im.WaterRGBA[0] * 255, Im.WaterRGBA[1] * 255, Im.WaterRGBA[2] * 255, Im.WaterRGBA[3] * 255 end if imgui.ColorEdit4("PostFx1", Im.PostFx1RGBA, imgui.ColorEditFlags.AlphaBar) then CTimeCycle.m_fPostFx1Red[i], CTimeCycle.m_fPostFx1Green[i], CTimeCycle.m_fPostFx1Blue[i], CTimeCycle.m_fPostFx1Alpha[i] = Im.PostFx1RGBA[0] * 255, Im.PostFx1RGBA[1] * 255, Im.PostFx1RGBA[2] * 255, Im.PostFx1RGBA[3] * 255 end if imgui.ColorEdit4("PostFx2", Im.PostFx2RGBA, imgui.ColorEditFlags.AlphaBar) then CTimeCycle.m_fPostFx2Red[i], CTimeCycle.m_fPostFx2Green[i], CTimeCycle.m_fPostFx2Blue[i], CTimeCycle.m_fPostFx2Alpha[i] = Im.PostFx2RGBA[0] * 255, Im.PostFx2RGBA[1] * 255, Im.PostFx2RGBA[2] * 255, Im.PostFx2RGBA[3] * 255 end if imgui.SliderInt(u8"Прозрачность облаков", Im.CloudAlpha, 0, 255) then CTimeCycle.m_fCloudAlpha[i] = Im.CloudAlpha[0] end if imgui.SliderInt(u8"Мин. интенсивность освещения", Im.HighLightMinIntensity, 0 ,255) then CTimeCycle.m_nHighLightMinIntensity[i] = Im.HighLightMinIntensity[0] end if imgui.SliderInt(u8"Прозрачность тумана на воде", Im.WaterFogAlpha, 0, 255) then CTimeCycle.m_nWaterFogAlpha[i] = Im.WaterFogAlpha[0] end if imgui.SliderInt(u8"Сила освещения", Im.DirectionalMult, 0, 255) then CTimeCycle.m_nDirectionalMult[i] = Im.DirectionalMult[0] end if imgui.Button(u8"Сохранить таймцикл") then CTimeCycle.SaveToFile("timecyc") printStringNow("Timecyc created!", 1000) end imgui.PopItemWidth() end end imgui.PopStyleColor() imgui.PopFont() imgui.End() end ) function imgui.AddTextColoredHex(DL, pos, text, defaultColor, out, outcol, fontsize, font, alpha) local function explode_hex(hex) local r = tonumber(hex:sub(1, 2), 16) local g = tonumber(hex:sub(3, 4), 16) local b = tonumber(hex:sub(5, 6), 16) return r, g, b end local charIndex, lastColorCharIndex, lastColor = 0, -100, defaultColor imgui.PushFont(font) local text_without_colors = text:gsub('{%x%x%x%x%x%x}', '') for Char in text:gmatch('.') do charIndex = charIndex + 1 if Char == '{' and text:sub(charIndex + 7, charIndex + 7) == '}' then local hexColor = text:sub(charIndex + 1, charIndex + 6) lastColorCharIndex = charIndex lastColor = hexColor end if charIndex < lastColorCharIndex or charIndex > lastColorCharIndex + 7 then local r, g, b = explode_hex(type(lastColor) == 'string' and lastColor or defaultColor) if out > 0 then DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x + out, pos.y + out), imgui.GetColorU32Vec4(outcol), u8(Char)) DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x - out, pos.y - out), imgui.GetColorU32Vec4(outcol), u8(Char)) DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x + out, pos.y - out), imgui.GetColorU32Vec4(outcol), u8(Char)) DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x - out, pos.y + out), imgui.GetColorU32Vec4(outcol), u8(Char)) end DL:AddTextFontPtr(font, fontsize, pos, imgui.GetColorU32Vec4(imgui.ImVec4(r / 255, g / 255, b / 255, alpha)), u8(Char)) pos.x = pos.x + imgui.CalcTextSize(u8(Char)).x + (Char == ' ' and 2 or 0) end end imgui.PopFont() end function AddNotify(text, displayTime, width) sampAddChatMessage(text, 0x88aa62) end -------------------------------- [ system info] -------------------------------- ffi.cdef[[ typedef unsigned long DWORD_PTR; typedef unsigned short WORD; typedef void *LPVOID; typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; }; }; DWORD dwPageSize; LPVOID lpMinimumApplicationAddress; LPVOID lpMaximumApplicationAddress; DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; WORD wProcessorLevel; WORD wProcessorRevision; } SYSTEM_INFO; void GetSystemInfo(SYSTEM_INFO *lpSystemInfo); typedef unsigned long DWORD_PTR; typedef struct _MEMORYSTATUSEX { DWORD dwLength; DWORD dwMemoryLoad; unsigned long long ullTotalPhys; unsigned long long ullAvailPhys; unsigned long long ullTotalPageFile; unsigned long long ullAvailPageFile; unsigned long long ullTotalVirtual; unsigned long long ullAvailVirtual; unsigned long long ullAvailExtendedVirtual; } MEMORYSTATUSEX; int GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer); typedef wchar_t WCHAR; typedef struct { DWORD cb; WCHAR DeviceName[32]; WCHAR DeviceString[128]; DWORD StateFlags; WCHAR DeviceID[128]; WCHAR DeviceKey[128]; } DISPLAY_DEVICEW; bool EnumDisplayDevicesW(const WCHAR*, DWORD, DISPLAY_DEVICEW*, DWORD); ]] local mySystem_Info = { processor_Name = "", } -- Определяем название CPU local function getProcessorName() local function getProcessorName_code(n) local qwords = ffi.typeof("uint64_t[?]") local dwords = ffi.typeof("uint32_t *") local cpuid_EAX_EDX = ffi.cast("__cdecl uint64_t (*)(uint32_t)", "\x53\x0F\xA2\x5B\xC3") local cpuid_EBX_ECX = ffi.cast("__cdecl uint64_t (*)(uint32_t)", "\x53\x0F\xA2\x91\x92\x93\x5B\xC3") local arr = ffi.cast(dwords, qwords(2, cpuid_EAX_EDX(n), cpuid_EBX_ECX(n))) return ffi.string(arr, 4), ffi.string(arr + 2, 4), ffi.string(arr + 3, 4), ffi.string(arr + 1, 4) end local s1 = "" for n = 0x80000002, 0x80000004 do local eax, ebx, ecx, edx = getProcessorName_code(n) s1 = s1..eax..ebx..ecx..edx end s1 = s1:gsub("^%s+", ""):gsub("%z+$", "") return s1 end -- Определяем кол-во ОЗУ local function getSystemMemory() local memStatus = ffi.new("MEMORYSTATUSEX") memStatus.dwLength = ffi.sizeof("MEMORYSTATUSEX") ffi.C.GlobalMemoryStatusEx(memStatus) return tonumber(memStatus.ullTotalPhys) end -- Определяем доступную ОЗУ local function getFreeMemory() local memStatus = ffi.new("MEMORYSTATUSEX") memStatus.dwLength = ffi.sizeof("MEMORYSTATUSEX") ffi.C.GlobalMemoryStatusEx(memStatus) return tonumber(memStatus.ullAvailPhys) end -- Преобразование wchar_t в строку Lua local function wcharToString(wstr) local str = {} local i = 0 while wstr[i] ~= 0 do str[i+1] = string.char(wstr[i]) i = i + 1 end return table.concat(str) end -- Получаем название графического адаптера local function getGraphicsCardName() local user32 = ffi.load("user32") local iDevNum = 0 local dd = ffi.new("DISPLAY_DEVICEW") dd.cb = ffi.sizeof(dd) dd.DeviceName = ffi.new("WCHAR[32]") dd.DeviceString = ffi.new("WCHAR[128]") dd.DeviceID = ffi.new("WCHAR[128]") dd.DeviceKey = ffi.new("WCHAR[128]") while user32.EnumDisplayDevicesW(nil, iDevNum, dd, 0) ~= 0 do if bit.band(dd.StateFlags, 0x00000001) ~= 0 then return wcharToString(dd.DeviceString) end iDevNum = iDevNum + 1 end return nil end local ProcessorName, GraphicsCardName = getProcessorName(), getGraphicsCardName() -- Получаем информацию о системе function getSystemInfo() mySystem_Info.processor_Name = ProcessorName mySystem_Info.total_Memory = getSystemMemory() / (1024 * 1024 * 1024) mySystem_Info.free_Memory = getFreeMemory() / (1024 * 1024 * 1024) mySystem_Info.graphics_Card = GraphicsCardName return mySystem_Info end ---------------------------------------------------------------------------------------- local newFrame = imgui.OnFrame( function() return UI.main[0] end, function(gtwea) gtwea.HideCursor = not UI.main[0] if isKeyDown(32) and gtwea.HideCursor == false then gtwea.HideCursor = true elseif not isKeyDown(32) and gtwea.HideCursor == true and UI.main[0] then gtwea.HideCursor = false end imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5)) imgui.SetNextWindowSize(imgui.ImVec2(940, 610), imgui.Cond.FirstUseEver) imgui.PushStyleVarVec2(imgui.StyleVar.WindowPadding, imgui.ImVec2(0, 0)) imgui.Begin("##GameTweaker", UI.main, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoResize + imgui.WindowFlags.NoBackground) imgui.PushStyleColor(imgui.Col.ChildBg, imgui.ImVec4(0.0, 0.0, 0.0, 0.0)) imgui.SetCursorPos(imgui.ImVec2(0, 0)) local draw_list = imgui.GetWindowDrawList() local p = imgui.GetCursorScreenPos() local eColor = imgui.GetStyle().Colors[imgui.Col.WindowBg] local col_box = imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorTop.r, config.ini.ColorTop.g, config.ini.ColorTop.b, config.ini.ColorTop.a)) local p = imgui.GetCursorScreenPos() imgui.GetWindowDrawList():AddRectFilledMultiColor(imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x + imgui.GetWindowWidth(), p.y + imgui.GetWindowHeight()), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorTop.r, config.ini.ColorTop.g, config.ini.ColorTop.b, config.ini.ColorTop.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorTop.r, config.ini.ColorTop.g, config.ini.ColorTop.b, config.ini.ColorTop.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.WindowBG.r, config.ini.WindowBG.g, config.ini.WindowBG.b, eColor.w)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.WindowBG.r, config.ini.WindowBG.g, config.ini.WindowBG.b, eColor.w))) imgui.GetWindowDrawList():AddRectFilledMultiColor(imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x+190, p.y + 1400), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a))) imgui.BeginChild("##LeftMenu", imgui.ImVec2(190, 430), false) imgui.SetCursorPos(imgui.ImVec2(0, 10)) imgui.PushFont(fonts[22]) imgui.PushFont(logofont) imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(config.ini.logocolor.r, config.ini.logocolor.g, config.ini.logocolor.b, config.ini.logocolor.a)) imgui.PopStyleColor(1) imgui.PopFont() imgui.PopFont() imgui.SetCursorPos(imgui.ImVec2(0, 70)) imgui.PushFont(fonts[22]) imgui.PushFont(iconFont) imgui.CustomMenu(navigations.home, navigations.activeTab.home, imgui.ImVec2(180, 37)) imgui.PopFont() imgui.PopFont() imgui.EndChild() imgui.SetCursorPos(imgui.ImVec2(20, imgui.GetWindowSize().y - 30)) imgui.PushFont(iconFont) imgui.PopFont() imgui.PopStyleColor(1) imgui.SameLine() imgui.PushStyleVarVec2(imgui.StyleVar.WindowPadding, imgui.ImVec2(10, 10)) imgui.PushStyleVarFloat(imgui.StyleVar.ChildRounding, 0) imgui.SetCursorPos(imgui.ImVec2(170, 0)) imgui.PushStyleVarFloat(imgui.StyleVar.ChildBorderSize, 0) imgui.BeginChild("##MainMenu", imgui.ImVec2(imgui.GetWindowSize().x - 10, imgui.GetWindowSize().y), true) if CloseButton(u8"", new.bool(true), imgui.ImVec2(imgui.GetWindowSize().x - 190, 10)) then UI.main[0] = false end imgui.Hint(u8"ESC - закрыть меню", 0.1) imgui.SetCursorPos(imgui.ImVec2(27, 35)) imgui.PopStyleVar() imgui.PushStyleColor(imgui.Col.Border, imgui.ImVec4(0.0, 0.0, 0.0, 0.0)) imgui.PushStyleColor(imgui.Col.ChildBg, imgui.ImVec4(0.0, 0.0, 0.0, 0.0)) imgui.BeginChild("##MainMenuVnutri", imgui.ImVec2(imgui.GetWindowSize().x - 175, imgui.GetWindowSize().y - 50), true) imgui.PopStyleColor(2) imgui.PushFont(fonts[18]) if navigations.activeTab.home[0] == 1 then imgui.SetCursorPos(imgui.ImVec2(imgui.GetWindowSize().x / 90, imgui.GetCursorPosY() + 8)) imgui.PushFont(fonts[50]) imgui.TextColored(imgui.ImVec4(config.ini.BeginColor.r, config.ini.BeginColor.g, config.ini.BeginColor.b, config.ini.BeginColor.a), u8"О системе") imgui.PopFont() imgui.PushStyleColor(imgui.Col.Border, config.ini.borderchild.draw and imgui.GetStyle().Colors[imgui.Col.PlotHistogram] or imgui.ImVec4(0,0,0,0)) imgui.BeginChild("##rightmenugg", imgui.ImVec2(imgui.GetWindowSize().x - 45, imgui.GetWindowSize().y - 90), true) imgui.PopStyleColor(1) imgui.SetCursorPos(imgui.ImVec2(10,340)) imgui.MainBox("informationsystem", imgui.ImVec2(670,120), 0) imgui.PushFont(fonts[22]) imgui.PushStyleColor(imgui.Col.Text, col1) local info = getSystemInfo() imgui.Text(u8"Информация о системе") imgui.PopStyleColor() imgui.PopFont() imgui.Spacing() imgui.PushStyleColor(imgui.Col.Text, col2) imgui.Text(u8"CPU: "..info.processor_Name) imgui.Text(u8"ОЗУ: "..string.format("%.2f GB", info.total_Memory)) imgui.SameLine() imgui.Text(u8"\tДоступно: "..string.format("%.2f GB", info.free_Memory)) imgui.SameLine() imgui.Text(u8"\tЗанято игрой: "..("%d"):format(tonumber(get_memory()))..u8" МБ") imgui.SameLine() imgui.SetCursorPosY(imgui.GetCursorPos().y - 3) if imgui.Button(u8"Освободить", imgui.ImVec2(100, 24)) then gotofunc("CleanMemory") end if info.graphics_Card then imgui.Text(u8"GPU: "..info.graphics_Card) end imgui.PopStyleColor() imgui.EndChild() imgui.EndChild() elseif navigations.activeTab.home[0] == 2 then imgui.SetCursorPos(imgui.ImVec2(imgui.GetWindowSize().x / 90, imgui.GetCursorPosY() + 8)) imgui.PushFont(fonts[50]) imgui.TextColored(imgui.ImVec4(config.ini.BeginColor.r, config.ini.BeginColor.g, config.ini.BeginColor.b, config.ini.BeginColor.a), u8"Оптимизация") imgui.PopFont() imgui.PushStyleColor(imgui.Col.Border, config.ini.borderchild.draw and imgui.GetStyle().Colors[imgui.Col.PlotHistogram] or imgui.ImVec4(0,0,0,0)) imgui.PushStyleColor(imgui.Col.Border, config.ini.borderchild.draw and imgui.GetStyle().Colors[imgui.Col.PlotHistogram] or imgui.ImVec4(0,0,0,0)) for i, title in ipairs(navigations.optimization) do if HeaderButton(navigations.current_optimization == i, title) then navigations.current_optimization = i end if i ~= #navigations.optimization then imgui.SameLine(nil, 20) end end imgui.SetCursorPos(imgui.ImVec2(imgui.GetCursorPosX(), imgui.GetCursorPosY() + 5)) imgui.BeginChild("##rightmenuddd", imgui.ImVec2(imgui.GetWindowSize().x - 30, imgui.GetWindowSize().y - 110), true) imgui.PopStyleColor(2) if navigations.current_optimization == 1 then if imgui.Checkbox(u8"Включить ограничитель кадров", checkboxes.framelimiter) then config.ini.settings.framelimiter = checkboxes.framelimiter[0] config.save() end if config.ini.settings.framelimiter then imgui.Text(u8"Информация:") imgui.BulletText(u8"Параметр выше 299 скрипт будет понимать как БЕЗ ОГРАНИЧЕНИЯ.") imgui.PushItemWidth(480) imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##Пешком", sliders.pedfps, 5, 300, u8"Пешком: %d FPS", 350) then config.ini.smart_fps.pedfps = sliders.pedfps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В машине", sliders.vehfps, 5, 300, u8"В машине: %d FPS", 350) then config.ini.smart_fps.vehfps = sliders.vehfps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В лодке", sliders.boatfps, 5, 300, u8"В лодке: %d FPS", 350) then config.ini.smart_fps.boatfps = sliders.boatfps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В мотоциклах", sliders.motofps, 5, 300, u8"В мотоциклах: %d FPS", 350) then config.ini.smart_fps.motofps = sliders.motofps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В велосипедах", sliders.bikefps, 5, 300, u8"В велосипедах: %d FPS", 350) then config.ini.smart_fps.bikefps = sliders.bikefps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##Во время плавания", sliders.swimfps, 5, 300, u8"Во время плавания: %d FPS", 350) then config.ini.smart_fps.swimfps = sliders.swimfps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В вертолетах", sliders.helifps, 5, 300, u8"В вертолетах: %d FPS", 350) then config.ini.smart_fps.helifps = sliders.helifps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##В самолетах", sliders.planefps, 5, 300, u8"В самолетах: %d FPS", 350) then config.ini.smart_fps.planefps = sliders.planefps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##sniper", sliders.snipergunfps, 5, 300, u8"Со снайперкой: %d FPS", 350) then config.ini.smart_fps.snipergunfps = sliders.snipergunfps[0] config.save() end imgui.SetCursorPosY(imgui.GetCursorPosY()+10) if imgui.CustomSlider(u8"##spray", sliders.spraygunfps, 5, 300, u8"С балончиком краски: %d FPS", 350) then config.ini.smart_fps.spraygunfps = sliders.spraygunfps[0] config.save() end imgui.PopItemWidth() end end imgui.EndChild() end imgui.PopFont() imgui.EndChild() imgui.EndChild() imgui.End() end ) function imgui.TextColoredRGB(text) local style = imgui.GetStyle() local colors = style.Colors local ImVec4 = imgui.ImVec4 local explode_argb = function(argb) local a = bit.band(bit.rshift(argb, 24), 0xFF) local r = bit.band(bit.rshift(argb, 16), 0xFF) local g = bit.band(bit.rshift(argb, 8), 0xFF) local b = bit.band(argb, 0xFF) return a, r, g, b end local getcolor = function(color) if color:sub(1, 6):upper() == 'SSSSSS' then local r, g, b = colors[1].x, colors[1].y, colors[1].z local a = tonumber(color:sub(7, 8), 16) or colors[1].w * 255 return ImVec4(r, g, b, a / 255) end local color = type(color) == 'string' and tonumber(color, 16) or color if type(color) ~= 'number' then return end local r, g, b, a = explode_argb(color) return imgui.ImVec4(r/255, g/255, b/255, a/255) end local render_text = function(text_) for w in text_:gmatch('[^\r\n]+') do local text, colors_, m = {}, {}, 1 w = w:gsub('{(......)}', '{%1FF}') while w:find('{........}') do local n, k = w:find('{........}') local color = getcolor(w:sub(n + 1, k - 1)) if color then text[#text], text[#text + 1] = w:sub(m, n - 1), w:sub(k + 1, #w) colors_[#colors_ + 1] = color m = n end w = w:sub(1, n - 1) .. w:sub(k + 1, #w) end if text[0] then for i = 0, #text do imgui.TextColored(colors_[i] or colors[1], u8(text[i])) imgui.SameLine(nil, 0) end imgui.NewLine() else imgui.Text(u8(w)) end end end render_text(text) end --==========================================[ Custom NameTags ] ======================================== function explode_argb(argb) local a = bit.band(bit.rshift(argb, 24), 0xFF) local r = bit.band(bit.rshift(argb, 16), 0xFF) local g = bit.band(bit.rshift(argb, 8), 0xFF) local b = bit.band(argb, 0xFF) return a, r, g, b end function join_argb(a, r, g, b) local argb = b -- b argb = bit.bor(argb, bit.lshift(g, 8)) -- g argb = bit.bor(argb, bit.lshift(r, 16)) -- r argb = bit.bor(argb, bit.lshift(a, 24)) -- a return argb end local getBonePosition = ffi.cast("int (__thiscall*)(void*, float*, int, bool)", 0x5E4280) function getBodyPartCoordinates(id, handle) local pedptr = getCharPointer(handle) local vec = ffi.new("float[3]") getBonePosition(ffi.cast("void*", pedptr), vec, id, true) return vec[0], vec[1], vec[2] end local lastFontSize = 0 local lastFontFlag = 0 local lastFontName = config.ini.custom_nametags.fontName function cntfont() if config.ini.custom_nametags.fontSize ~= lastFontSize or config.ini.custom_nametags.fontFlag ~= lastFontFlag or config.ini.custom_nametags.fontName ~= lastFontName then CNTrenderFont = renderCreateFont(config.ini.custom_nametags.fontName, config.ini.custom_nametags.fontSize, config.ini.custom_nametags.fontFlag) lastFontSize = config.ini.custom_nametags.fontSize lastFontFlag = config.ini.custom_nametags.fontFlag lastFontName = config.ini.custom_nametags.fontName end end --=============================================================================================================================================== function get_samp_version() if samp_base == nil or samp_base == 0 then samp_base = getModuleHandle("samp.dll") end if samp_base ~= 0 then local e_lfanew = ffi.cast("long*", samp_base + 60)[0] local nt_header = samp_base + e_lfanew local entry_point_addr = ffi.cast("unsigned int*", nt_header + 40)[0] local versions = { [0x31DF13] = "r1", [0x3195DD] = "r2", [0xCC4D0] = "r3", [0xCBCB0] = "r4", [0xFDB60] = "dl" } return versions[entry_point_addr] or "unknown" end return "unknown" end --исходящие RakLua.registerHandler(RakLuaEvents.OUTGOING_RPC, function(id, bs, priority, reliability, orderingChannel, shiftTimestamp) if id == 119 then local posX, posY, posZ = bs:readFloat(), bs:readFloat(), bs:readFloat() lua_thread.create(function() for i = 0, 4 do requestCollision(posX, posY) wait(100) loadScene(posX, posY, posZ) end end) local res, x, y, z = getTargetBlipCoordinates() if res then local new_bs = RakLuaBitStream.new() new_bs:writeFloat(x) new_bs:writeFloat(y) new_bs:writeFloat(z+0.80) new_bs:sendRPC(119) end return false end if config.ini.ugenrl_main.enable then if id == 115 then local act = bs:readBool() dmgId = bs:readInt16() dmgValue = bs:readFloat() dmgWeaponId = bs:readInt32() dmgBodypart = bs:readInt32() if config.ini.ugenrl_main.pain and act and dmgWeaponId ~= 53 then playPain = true end if config.ini.ugenrl_main.hit and not act then playHit = true end end end if id == 25 then lua_thread.create(function() wait(3000) if representIntAsFloat(readMemory(0xFFFC90, 4, true)) ~= representIntAsFloat(readMemory(sampGetServerSettingsPtr() + 39, 4, true)) then memory_setfloat(0xFFFC90, representIntAsFloat(readMemory(sampGetServerSettingsPtr() + 39, 4, true)), true) gotofunc("SetDistNickNames") end gotofunc("GTATime") gotofunc("GTAWeather") gotofunc("InterfaceElementEditor") end) if config.ini.settings.connectedSound then playSound(config.ini.ugenrl_sounds.Connected, config.ini.ugenrl_volume.connected) end end if id == 50 then local cmd_len = bs:readInt32() local cmd = bs:readString(cmd_len) cmd = string.lower(cmd) if cmd:find("^"..config.ini.commands.openmenu.."$") then gotofunc("OpenMenu") return false elseif cmd:find("^"..config.ini.commands.tws.."$") then gotofunc("OpenTws") return false elseif cmd:find("^"..config.ini.commands.opentimecyccreator.."$") then gotofunc("OpenTimecycCreator") return false elseif cmd:find("^/gtunload$") then thisScript():unload() return false elseif cmd:find("^"..config.ini.commands.settime.." .+") or cmd:find("^"..config.ini.commands.settime.."$") then local hours = cmd:match(config.ini.commands.settime.." (%d+)") local min = cmd:match(config.ini.commands.settime.." %d+%s(%d+)") if min == nil then min = 0 end hours = tonumber(hours) min = tonumber(min) if config.ini.settings.blocktime then if type(hours) ~= 'number' or hours < 0 or hours > 23 or type(min) ~= 'number' or min < 0 or min > 59 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.settime.." [0-23 - часы] [0-59 - минуты]", 3000, 450) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.hours..":"..("%02d"):format(config.ini.settings.min), 3000) else config.ini.settings.hours = hours config.ini.settings.min = min config.save() sliders.hours[0] = config.ini.settings.hours sliders.min[0] = config.ini.settings.min gotofunc("SetTime") AddNotify(script_name.." {FFFFFF}Установлено время: {dc4747}"..config.ini.settings.hours..":"..("%02d"):format(config.ini.settings.min), 3000) end else AddNotify(script_name.." {FFFFFF}У вас стоит запрет на изменение времени, введите: {dc4747}"..config.ini.commands.blockservertime, 3000, 525) end return false elseif cmd:find("^"..config.ini.commands.setweather.." .+") or cmd:find("^"..config.ini.commands.setweather.."$") then local weather = cmd:match(config.ini.commands.setweather.."(.+)") weather = tonumber(weather) if config.ini.settings.blockweather then if type(weather) ~= 'number' or weather < 0 or weather > 45 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.setweather.." [0-45]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.weather, 3000) else config.ini.settings.weather = weather config.save() sliders.weather[0] = config.ini.settings.weather gotofunc("SetWeather") AddNotify(script_name.." {FFFFFF}Установлена погода: {dc4747}"..config.ini.settings.weather, 3000) end else AddNotify(script_name.." {FFFFFF}У вас стоит запрет на изменение погоды, введите: {dc4747}"..config.ini.commands.blockserverweather, 3000, 525) end return false elseif cmd:find("^"..config.ini.commands.blockservertime.."$") then config.ini.settings.blocktime = not config.ini.settings.blocktime config.save() checkboxes.blocktime[0] = config.ini.settings.blocktime gotofunc("BlockTime") gotofunc("SetTime") AddNotify(config.ini.settings.blocktime and script_name..' {FFFFFF}Теперь сервер {dc4747}не меняет {FFFFFF}вам время' or script_name..' {FFFFFF}Теперь сервер {88aa62}меняет {FFFFFF}вам время', 3000) return false elseif cmd:find("^"..config.ini.commands.blockserverweather.."$") then config.ini.settings.blockweather = not config.ini.settings.blockweather config.save() checkboxes.blockweather[0] = config.ini.settings.blockweather gotofunc("BlockWeather") gotofunc("SetWeather") AddNotify(config.ini.settings.blockweather and script_name..' {FFFFFF}Теперь сервер {dc4747}не меняет {FFFFFF}вам погоду' or script_name..' {FFFFFF}Теперь сервер {88aa62}меняет {FFFFFF}вам погоду', 3000) return false elseif cmd:find("^"..config.ini.commands.givemedist.."$") then config.ini.settings.givemedist = not config.ini.settings.givemedist AddNotify(config.ini.settings.givemedist and script_name..' {FFFFFF}Возможность менять прорисовку {88aa62}включена' or script_name..' {FFFFFF}Возможность менять прорисовку {dc4747}выключена', 3000) config.save() gotofunc("GivemeDist") return false elseif cmd:find("^"..config.ini.commands.givemedistobj.."$") then config.ini.settings.givemedistobj = not config.ini.settings.givemedistobj AddNotify(config.ini.settings.givemedistobj and script_name..' {FFFFFF}Возможность менять дальность видимости объектов {dc4747}выключена' or script_name..' {FFFFFF}Возможность менять дальность видимости объектов {88aa62}включена', 3000) config.save() gotofunc("SetDistObjects") return false elseif cmd:find("^"..config.ini.commands.drawdistance.." .+") or cmd:find("^"..config.ini.commands.drawdistance.."$") then local drawdist = cmd:match(config.ini.commands.drawdistance.." (.+)") drawdist = tonumber(drawdist) if config.ini.settings.givemedist then if type(drawdist) ~= 'number' or drawdist > 2000 or drawdist < 35 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.drawdistance.." [35-2000]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.drawdist, 3000) else config.ini.settings.drawdist = ("%.1f"):format(drawdist) config.save() sliders.drawdist[0] = tonumber(config.ini.settings.drawdist) AddNotify(script_name.." {FFFFFF}Установлена дальность прорисовки: {dc4747}"..config.ini.settings.drawdist, 3000) end else AddNotify(script_name.." {FFFFFF}У вас выключена возможность менять прорисовку, включите её: {dc4747}"..config.ini.commands.givemedist, 3000, 720) end return false elseif cmd:find("^"..config.ini.commands.drawdistanceair.." .+") or cmd:find("^"..config.ini.commands.drawdistanceair.."$") then local drawdistair = cmd:match(config.ini.commands.drawdistanceair.." (.+)") drawdistair = tonumber(drawdistair) if config.ini.settings.givemedist then if type(drawdistair) ~= 'number' or drawdistair > 2000 or drawdistair < 35 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.drawdistanceair.." [35-2000]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.drawdistair, 3000) else config.ini.settings.drawdistair = ("%.1f"):format(drawdistair) config.save() sliders.drawdistair[0] = tonumber(config.ini.settings.drawdistair) AddNotify(script_name.." {FFFFFF}Дальность прорисовки в воздушном транспорте установлена на: {dc4747}"..config.ini.settings.drawdistair, 3000) end else AddNotify(script_name.." {FFFFFF}У вас выключена возможность менять прорисовку, включите её: {dc4747}"..config.ini.commands.givemedist, 3000, 720) end return false elseif cmd:find("^"..config.ini.commands.drawdistancepara.." .+") or cmd:find("^"..config.ini.commands.drawdistancepara.."$") then local drawdistpara = cmd:match(config.ini.commands.drawdistancepara.." (.+)") drawdistpara = tonumber(drawdistpara) if config.ini.settings.givemedist then if type(drawdistpara) ~= 'number' or drawdistpara > 2000 or drawdistpara < 35 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.drawdistancepara.." [35-2000]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.drawdistpara, 3000) else config.ini.settings.drawdistpara = ("%.1f"):format(drawdistpara) config.save() sliders.drawdistpara[0] = tonumber(config.ini.settings.drawdistpara) AddNotify(script_name.." {FFFFFF}Дальность прорисовки при использовании парашюта установлена на: {dc4747}"..config.ini.settings.drawdistpara, 3000) end else AddNotify(script_name.." {FFFFFF}У вас выключена возможность менять прорисовку, включите её: {dc4747}"..config.ini.commands.givemedist, 3000, 720) end return false elseif cmd:find("^"..config.ini.commands.fogdistance.." .+") or cmd:find("^"..config.ini.commands.fogdistance.."$") then local fogdist = cmd:match(config.ini.commands.fogdistance.." (.+)") fogdist = tonumber(fogdist) if config.ini.settings.givemedist then if type(fogdist) ~= 'number' or fogdist > 2000 or fogdist < -2000 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.fogdistance.." [-2000 - 2000]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.fog, 3000) else config.ini.settings.fog = ("%.1f"):format(fogdist) config.save() sliders.fog[0] = tonumber(config.ini.settings.fog) memory_setfloat(13210352, config.ini.settings.fog, true) AddNotify(script_name.." {FFFFFF}Установлена дальность тумана: {dc4747}"..config.ini.settings.fog, 3000) end else AddNotify(script_name.." {FFFFFF}У вас выключена возможность менять прорисовку, включите её: {dc4747}"..config.ini.commands.givemedist, 3000, 720) end return false elseif cmd:find("^"..config.ini.commands.loddistance.." .+") or cmd:find("^"..config.ini.commands.loddistance.."$") then local loddist = cmd:match(config.ini.commands.loddistance.." (.+)") loddist = tonumber(loddist) if config.ini.settings.givemedist then if type(loddist) ~= 'number' or loddist > 2000 or loddist < 0 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.loddistance.." [0-2000]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.lod, 3000) else config.ini.settings.lod = ("%.1f"):format(loddist) config.save() sliders.lod[0] = tonumber(config.ini.settings.lod) gotofunc("LodDist") AddNotify(script_name.." {FFFFFF}Установлена дальность лодов: {dc4747}"..config.ini.settings.lod, 3000) end else AddNotify(script_name.." {FFFFFF}У вас выключена возможность менять прорисовку, включите её: {dc4747}"..config.ini.commands.givemedist, 3000, 720) end return false elseif cmd:find("^"..config.ini.commands.shownicks.."$") then config.ini.settings.shownicks = not config.ini.settings.shownicks gotofunc("ShowNICKS") config.save() AddNotify(config.ini.settings.shownicks and script_name..' {FFFFFF}Ники игроков {dc4747}выключены' or script_name..' {FFFFFF}Ники игроков {88aa62}включены', 3000) return false elseif cmd:find("^"..config.ini.commands.showhp.."$") then config.ini.settings.showhp = not config.ini.settings.showhp config.save() AddNotify(config.ini.settings.showhp and script_name..' {FFFFFF}Полоска ХП игроков {dc4747}отключена' or script_name..' {FFFFFF}Полоска ХП игроков {88aa62}включена', 3000) gotofunc("ShowHP") return false elseif cmd:find("^"..config.ini.commands.showchat.."$") then preset["Other"]["showchat"] = not preset["Other"]["showchat"] AddNotify(preset["Other"]["showchat"] and script_name..' {FFFFFF}Чат {dc4747}выключен' or script_name..' {FFFFFF}Чат {88aa62}включен', 3000) saveJson("preset") gotofunc("ShowCHAT") return false elseif cmd:find("^"..config.ini.commands.showhud.."$") then preset["Other"]["showhud"] = not preset["Other"]["showhud"] AddNotify(preset["Other"]["showhud"] and script_name..' {FFFFFF}HUD {dc4747}выключен' or script_name..' {FFFFFF}HUD {88aa62}включен', 3000) saveJson("preset") gotofunc("ShowHUD") return false elseif cmd:find("^"..config.ini.commands.fpslock.."$") then config.ini.settings.unlimitfps = not config.ini.settings.unlimitfps AddNotify(config.ini.settings.unlimitfps and script_name..' {FFFFFF}FPS unlock {88aa62}включен' or script_name..' {FFFFFF}FPS unlock {dc4747}выключен', 3000) config.save() gotofunc("FPSUnlock") return false elseif cmd:find("^"..config.ini.commands.postfx.."$") then config.ini.effects_manager.postfx = not config.ini.effects_manager.postfx AddNotify(config.ini.effects_manager.postfx and script_name..' {FFFFFF}Пост-обработка {dc4747}выключена' or script_name..' {FFFFFF}Пост-обработка {88aa62}включена', 3000) config.save() gotofunc("EffectsManager") return false elseif cmd:find("^"..config.ini.commands.autocleaner.."$") then config.ini.cleaner.autoclean = not config.ini.cleaner.autoclean config.save() AddNotify((script_name.."{FFFFFF} Автоматическая очистка памяти %s"):format(config.ini.cleaner.autoclean and "{88aa62}включена" or "{dc4747}выключена"), 3000) return false elseif cmd:find("^"..config.ini.commands.cleanmemory.."$") then gotofunc("CleanMemory") return false elseif cmd:find("^"..config.ini.commands.cleaninfo.."$") then config.ini.cleaner.cleaninfo = not config.ini.cleaner.cleaninfo config.save() checkboxes.cleaninfo[0] = config.ini.cleaner.cleaninfo AddNotify(config.ini.cleaner.cleaninfo and script_name..' {FFFFFF}Сообщение об очистке памяти {88aa62}включено' or script_name..' {FFFFFF}Сообщение об очистке памяти {dc4747}выключено', 3000) return false elseif cmd:find("^"..config.ini.commands.setmbforautocleaner.." .+") or cmd:find("^"..config.ini.commands.setmbforautocleaner.."$") then local setccl = cmd:match(config.ini.commands.setmbforautocleaner.." (.+)") setccl = tonumber(setccl) if type(setccl) ~= 'number' or setccl > 3000 or setccl < 0 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.setmbforautocleaner.." [0-3000 МБ]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.cleaner.limit.." МБ", 3000) else config.ini.cleaner.limit = setccl config.save() AddNotify(script_name.." {FFFFFF}Авто-очистка памяти установлена на: {dc4747}"..config.ini.cleaner.limit.." МБ", 3000) end return false elseif cmd:find("^"..config.ini.commands.ntgs.." .+") or cmd:find("^"..config.ini.commands.ntgs.."$") then local param = cmd:match(config.ini.commands.ntgs.." (.+)") param = tonumber(param) if config.ini.settings.givemedistnames then if readMemory(0xFFFC90, 4, true) ~= 697076735 then if type(param) ~= 'number' or param > tonumber(memory_getfloat(0xFFFC90, true)) or param < 0 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.ntgs.." [0-"..tonumber(memory_getfloat(0xFFFC90, true)).."]", 3000) AddNotify(config.ini.settings.nickdistance >= tonumber(memory_getfloat(0xFFFC90, true)) and script_name.." {FFFFFF}Текущий параметр: {dc4747}серверное значение" or script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.settings.nickdistance, 3000) else config.ini.settings.nickdistance = param config.save() sliders.nickdistance[0] = config.ini.settings.nickdistance gotofunc("SetDistNickNames") AddNotify(script_name.." {FFFFFF}Дистанция прорисовки никнеймов установлена на: {dc4747}"..config.ini.settings.nickdistance, 3000) end else AddNotify(script_name.." {FFFFFF}Не получены настройки сервера. {dc4747}Переподключитесь к серверу!", 3000, 600) end else AddNotify(script_name.." {FFFFFF}У вас не включена функция. Введите: {dc4747}/givemedistnames", 3000, 540) end return false elseif cmd:find("^"..config.ini.commands.givemedistnames.."$") then config.ini.settings.givemedistnames = not config.ini.settings.givemedistnames config.save() AddNotify(config.ini.settings.givemedistnames and script_name..' {FFFFFF}Возможность менять прорисовку никнеймов {88aa62}включена' or script_name..' {FFFFFF}Возможность менять прорисовку никнеймов {dc4747}выключена', 3000) gotofunc("SetDistNickNames") return false elseif cmd:find("^"..config.ini.commands.editcrosshair.." .+%s.+") or cmd:find("^"..config.ini.commands.editcrosshair.."$") then local crX1 = cmd:match(config.ini.commands.editcrosshair.." (.+)%s.+") local crY1 = cmd:match(config.ini.commands.editcrosshair.." .+%s(.+)") crX1 = tonumber(crX1) crY1 = tonumber(crY1) if type(crY1) ~= 'number' or type(crX1) ~= 'number' or crX1 > 1000 or crX1 < 0 or crY1 > 1000 or crY1 < 0 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.editcrosshair.." [X: 0.0-255.0] [Y: 0.0-255.0]", 3000) AddNotify(script_name.." {FFFFFF}Текущие параметры: {dc4747}X: "..preset["Crosshair"]["crosshairSizeX"].." Y: "..preset["Crosshair"]["crosshairSizeY"], 3000) else preset["Crosshair"]["crosshairSizeX"] = crX1 preset["Crosshair"]["crosshairSizeY"] = crY1 buffers.crosshairX[0] = crX1 buffers.crosshairY[0] = crY1 saveJson("preset") gotofunc("EditCrosshair") AddNotify(script_name.." {FFFFFF}Установлен размер прицела: {dc4747}X: "..preset["Crosshair"]["crosshairSizeX"].." Y: "..preset["Crosshair"]["crosshairSizeY"], 3000) end return false elseif cmd:find("^"..config.ini.commands.setfps.." .+") or cmd:find("^"..config.ini.commands.setfps.."$")then local param = cmd:match(config.ini.commands.setfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.setfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.pedfps, 3000) else config.ini.smart_fps.pedfps = param config.save() sliders.pedfps[0] = config.ini.smart_fps.pedfps AddNotify(script_name.." {FFFFFF}Фпс с ног установлен на: {dc4747}"..config.ini.smart_fps.pedfps, 3000) end return false elseif cmd:find("^"..config.ini.commands.vehfps.." .+") or cmd:find("^"..config.ini.commands.vehfps.."$")then local param = cmd:match(config.ini.commands.vehfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.vehfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.vehfps, 3000) else config.ini.smart_fps.vehfps = param config.save() sliders.vehfps[0] = config.ini.smart_fps.vehfps AddNotify(script_name.." {FFFFFF}Фпс в авто установлен на: {dc4747}"..config.ini.smart_fps.vehfps, 3000) end return false elseif cmd:find("^"..config.ini.commands.motofps.." .+") or cmd:find("^"..config.ini.commands.motofps.."$")then local param = cmd:match(config.ini.commands.motofps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.motofps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.motofps, 3000) else config.ini.smart_fps.motofps = param config.save() sliders.motofps[0] = config.ini.smart_fps.motofps AddNotify(script_name.." {FFFFFF}Фпс в мотоциклах установлен на: {dc4747}"..config.ini.smart_fps.motofps, 3000) end return false elseif cmd:find("^"..config.ini.commands.bikefps.." .+") or cmd:find("^"..config.ini.commands.bikefps.."$")then local param = cmd:match(config.ini.commands.bikefps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.bikefps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.bikefps, 3000) else config.ini.smart_fps.bikefps = param config.save() sliders.bikefps[0] = config.ini.smart_fps.bikefps AddNotify(script_name.." {FFFFFF}Фпс в велосипедах установлен на: {dc4747}"..config.ini.smart_fps.bikefps, 3000) end return false elseif cmd:find("^"..config.ini.commands.boatfps.." .+") or cmd:find("^"..config.ini.commands.boatfps.."$")then local param = cmd:match(config.ini.commands.boatfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.boatfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.boatfps, 3000) else config.ini.smart_fps.boatfps = param config.save() sliders.boatfps[0] = config.ini.smart_fps.boatfps AddNotify(script_name.." {FFFFFF}Фпс в лодках установлен на: {dc4747}"..config.ini.smart_fps.boatfps, 3000) end return false elseif cmd:find("^"..config.ini.commands.planefps.." .+") or cmd:find("^"..config.ini.commands.planefps.."$")then local param = cmd:match(config.ini.commands.planefps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.planefps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.planefps, 3000) else config.ini.smart_fps.planefps = param config.save() sliders.planefps[0] = config.ini.smart_fps.planefps AddNotify(script_name.." {FFFFFF}Фпс в самолетах установлен на: {dc4747}"..config.ini.smart_fps.planefps, 3000) end return false elseif cmd:find("^"..config.ini.commands.helifps.." .+") or cmd:find("^"..config.ini.commands.helifps.."$")then local param = cmd:match(config.ini.commands.helifps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.helifps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.helifps, 3000) else config.ini.smart_fps.helifps = param config.save() sliders.helifps[0] = config.ini.smart_fps.helifps AddNotify(script_name.." {FFFFFF}Фпс в вертолетах установлен на: {dc4747}"..config.ini.smart_fps.helifps, 3000) end return false elseif cmd:find("^"..config.ini.commands.swimfps.." .+") or cmd:find("^"..config.ini.commands.swimfps.."$")then local param = cmd:match(config.ini.commands.swimfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.swimfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.swimfps, 3000) else config.ini.smart_fps.swimfps = param config.save() sliders.swimfps[0] = config.ini.smart_fps.swimfps AddNotify(script_name.." {FFFFFF}Фпс во время плавания установлен на: {dc4747}"..config.ini.smart_fps.swimfps, 3000) end return false elseif cmd:find("^"..config.ini.commands.snipergunfps.." .+") or cmd:find("^"..config.ini.commands.snipergunfps.."$")then local param = cmd:match(config.ini.commands.snipergunfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.snipergunfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.snipergunfps, 3000) else config.ini.smart_fps.snipergunfps = param config.save() sliders.snipergunfps[0] = config.ini.smart_fps.snipergunfps AddNotify(script_name.." {FFFFFF}Фпс Sniper Gun установлен на: {dc4747}"..config.ini.smart_fps.snipergunfps, 3000) end return false elseif cmd:find("^"..config.ini.commands.spraygunfps.." .+") or cmd:find("^"..config.ini.commands.spraygunfps.."$") then local param = cmd:match(config.ini.commands.spraygunfps.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 5 or param > 300 then AddNotify(script_name.." {FFFFFF}Используйте: {dc4747}"..config.ini.commands.spraygunfps.." [5-300]", 3000) AddNotify(script_name.." {FFFFFF}Текущий параметр: {dc4747}"..config.ini.smart_fps.spraygunfps, 3000) else config.ini.smart_fps.spraygunfps = param config.save() sliders.spraygunfps[0] = config.ini.smart_fps.spraygunfps AddNotify(script_name.." {FFFFFF}Фпс Spray Can установлен на: {dc4747}"..config.ini.smart_fps.spraygunfps, 3000) end return false end end end ) RakLua.registerHandler(RakLuaEvents.INCOMING_PACKET, function(id, bs) if config.ini.settings.disconnectSound then if id == 32 or id == 33 or id == 36 then playSound(config.ini.ugenrl_sounds.Disconnected, config.ini.ugenrl_volume.disconnected) end end end ) chatBubbles = chatBubbles or {}; function getNearCharToCenter(radius) local arr = {} local sx, sy = getScreenResolution() for _, player in ipairs(getAllChars()) do if doesCharExist(player) then if select(1, sampGetPlayerIdByCharHandle(player)) and isCharOnScreen(player) and player ~= playerPed then local plX, plY, plZ = getCharCoordinates(player) local cX, cY = convert3DCoordsToScreen(plX, plY, plZ) local distBetween2d = getDistanceBetweenCoords2d(sx / 2, sy / 2, cX, cY) if distBetween2d <= tonumber(radius and radius or sx) then table.insert(arr, {distBetween2d, player}) end end end end if #arr > 0 then table.sort(arr, function(a, b) return (a[1] < b[1]) end) return arr[1][2] end return nil end function onReceiveRpc(id, bs)--входящие рпс if id == 124 then -- toggle spec isSpectator = raknetBitStreamReadInt32(bs) == 1 and true or false end if id == 126 then -- spec player spectatorPlayer = raknetBitStreamReadInt16(bs) end if id == 127 then lua_thread.create( function() wait(500) local player = getNearCharToCenter(150) -- 150 это радиус на экране (в пикселях) а не в 3d пространстве относительно вас if player then local playerId = select(2, sampGetPlayerIdByCharHandle(player)) spectatorPlayer = playerId end end ) end if id == 73 and not gameTextUsedServer then gameTextUsedServer = true lua_thread.create(function() wait(5000) gameTextUsedServer = false end) end if config.ini.settings.opendialogSound and id == 61 then playSound(config.ini.ugenrl_sounds.OpenDialog, config.ini.ugenrl_volume.opendialog) end if id == 55 and config.ini.ugenrl_main.enable and config.ini.ugenrl_main.kill then local killerID = raknetBitStreamReadInt16(bs) local playerID = raknetBitStreamReadInt16(bs) local reason = raknetBitStreamReadInt8(bs) if killerID < 65535 then local res, myID = sampGetPlayerIdByCharHandle(PLAYER_PED) if killerID == myID then playKill = true end end end if config.ini.settings.disconnectSound and id == 40 then playSound(config.ini.ugenrl_sounds.Disconnected, config.ini.ugenrl_volume.disconnected) end if id == 36 then local TextId = raknetBitStreamReadInt16(bs) local Color = raknetBitStreamReadInt32(bs) local x = raknetBitStreamReadFloat(bs) local y = raknetBitStreamReadFloat(bs) local z = raknetBitStreamReadFloat(bs) local DrawDistance = raknetBitStreamReadFloat(bs) local testLOS = raknetBitStreamReadInt8(bs) local attachedPlayer = raknetBitStreamReadInt16(bs) local attachedVehicle =raknetBitStreamReadInt16(bs) if attachedVehicle < 65535 and config.ini.settings.no3dTextVehicles then return false end if attachedPlayer < 65535 and config.ini.settings.no3dTextPlayers then return false end end if (id == 29 or id == 94 or id == 30) then if config.ini.settings.blocktime then return false end end if id == 152 and config.ini.settings.blockweather then return false end if id == 41 and config.ini.ugenrl_main.enable then return false end if id == 59 and config.ini.custom_nametags.status then local playerId = raknetBitStreamReadInt16(bs) local color = raknetBitStreamReadInt32(bs) local dist = raknetBitStreamReadFloat(bs) local time = raknetBitStreamReadInt32(bs) local len_text = raknetBitStreamReadInt8(bs) local text = raknetBitStreamReadString(bs, len_text) -- Удаляем предыдущий чат-бабл for k, v in pairs(chatBubbles) do if v["playerid"] == playerId then table.remove(chatBubbles, k) break end end -- Создаём новый чат-бабл local tbl = { ["playerid"] = playerId, ["color"] = color, ["dist"] = dist, ["time"] = os.time() + time / 1000, ["text"] = text } table.insert(chatBubbles, tbl); return false end end function getMDO(id_obj) return id_obj ~= nil and (callFunction(0x403DA0, 1, 1, id_obj) + 24) or false end HeaderButton = function(bool, str_id) local DL = imgui.GetWindowDrawList() local ToU32 = imgui.ColorConvertFloat4ToU32 local result = false local label = string.gsub(str_id, "##.*$", "") local duration = { 0.5, 0.3 } local cols = { idle = imgui.GetStyle().Colors[imgui.Col.TextDisabled], hovr = imgui.GetStyle().Colors[imgui.Col.Text], slct = imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] } if not AI_HEADERBUT then AI_HEADERBUT = {} end if not AI_HEADERBUT[str_id] then AI_HEADERBUT[str_id] = { color = bool and cols.slct or cols.idle, clock = os.clock() + duration[1], h = { state = bool, alpha = bool and 1.00 or 0.00, clock = os.clock() + duration[2], } } end local pool = AI_HEADERBUT[str_id] local degrade = function(before, after, start_time, duration) local result = before local timer = os.clock() - start_time if timer >= 0.00 then local offs = { x = after.x - before.x, y = after.y - before.y, z = after.z - before.z, w = after.w - before.w } result.x = result.x + ( (offs.x / duration) * timer ) result.y = result.y + ( (offs.y / duration) * timer ) result.z = result.z + ( (offs.z / duration) * timer ) result.w = result.w + ( (offs.w / duration) * timer ) end return result end local pushFloatTo = function(p1, p2, clock, duration) local result = p1 local timer = os.clock() - clock if timer >= 0.00 then local offs = p2 - p1 result = result + ((offs / duration) * timer) end return result end local set_alpha = function(color, alpha) return imgui.ImVec4(color.x, color.y, color.z, alpha or 1.00) end imgui.BeginGroup() local pos = imgui.GetCursorPos() local p = imgui.GetCursorScreenPos() imgui.TextColored(pool.color, label) local s = imgui.GetItemRectSize() local hovered = imgui.IsItemHovered() local clicked = imgui.IsItemClicked() if pool.h.state ~= hovered and not bool then pool.h.state = hovered pool.h.clock = os.clock() end if clicked then pool.clock = os.clock() result = true end if os.clock() - pool.clock <= duration[1] then pool.color = degrade( imgui.ImVec4(pool.color), bool and cols.slct or (hovered and cols.hovr or cols.idle), pool.clock, duration[1] ) else pool.color = bool and cols.slct or (hovered and cols.hovr or cols.idle) end if pool.h.clock ~= nil then if os.clock() - pool.h.clock <= duration[2] then pool.h.alpha = pushFloatTo( pool.h.alpha, pool.h.state and 1.00 or 0.00, pool.h.clock, duration[2] ) else pool.h.alpha = pool.h.state and 1.00 or 0.00 if not pool.h.state then pool.h.clock = nil end end local max = s.x / 2 local Y = p.y + s.y + 3 local mid = p.x + max DL:AddLine(imgui.ImVec2(mid, Y), imgui.ImVec2(mid + (max * pool.h.alpha), Y), ToU32(set_alpha(pool.color, pool.h.alpha)), 3) DL:AddLine(imgui.ImVec2(mid, Y), imgui.ImVec2(mid - (max * pool.h.alpha), Y), ToU32(set_alpha(pool.color, pool.h.alpha)), 3) end imgui.EndGroup() return result end -- Таблица для отслеживания вызовов функции local cleanMemoryTimestamps = cleanMemoryTimestamps or {} local lastWarningTime = lastWarningTime or 0 -- Время последнего предупреждения local isCleaning = isCleaning or false -- Флаг выполнения очистки function gotofunc(fnc) if config.ini.settings.debug_info then sampfuncsLog("["..os.date("%H:%M:%S").."] {88aa62}"..script_name.."{FFFFFF} Вызов функции: {dc4747}"..fnc) end ------------------------------------fixes and other----------------------------- if fnc == "all" then --------------------------[[fix radio icon in menu pause]]------------------------------ writeMemory(0xCDCDCD, 4, representFloatAsInt(0.098125), true) -- Y неактив std 0.078125 writeMemory(0xCDCDDD, 4, representFloatAsInt(0.0546875), true) -- X неактив std 0.0546875 writeMemory(0xDDDDDD, 4, representFloatAsInt(0.08375), true) -- X актив std 0.09375 writeMemory(0xCDDDDD, 4, representFloatAsInt(0.14392857), true) -- Y актив std 0.13392857 writeMemory(0x57473B+2, 4, 0xCDCDCD, true) -- Y неактив 0.078125 writeMemory(0x574761+2, 4, 0xCDCDDD, true) -- X неактив 0.0546875 writeMemory(0x57482F+2, 4, 0xCDDDDD, true) -- Y актив writeMemory(0x574857+2, 4, 0xDDDDDD, true) -- X актив ----------------------------------------------------------------------------------------- LoadPatch() callFunction(0x7469A0, 0, 0) --mousefix in pause -- Fix Mouse not restoring properly after returning from ALT+TAB or MINIMIZED -- Disable re-initialization of DirectInput mouse device by the game writeMemory(0x748808, 1, 0xEB, true) writeMemory(0x7487C1, 1, 0xEB, true) writeMemory(0x53F31D, 1, 0xEB, true) writeMemory(0x53F3F1, 1, 0xEB, true) writeMemory(0x576CCC, 1, 0xEB, true) writeMemory(0x576EBA, 1, 0xEB, true) writeMemory(0x576F8A, 1, 0xEB, true) --[[ push = + 1 fld or fmul or fsub or fadd = + 2 lea + 3 mov = + 4 ]] ------------------------------------------ --sensfix memory.write(5382798, 0xB6EC1C, 4, true) memory.write(5311528, 0xB6EC1C, 4, true) memory.write(5316106, 0xB6EC1C, 4, true) ------ memory.write(0x058E280, 0xEB, 1, true)--white fuck in crosshair memory.setint8(0x4414C0, 0xC3, false)--PassingOfTimeOnDeath memory.setint8(0x732F5D+1, 0, true) -- fog weapons fix (1 orig) memory.setuint32(0x736F88, 0, true)-- AirCraftExplosionFix writeMemory(0x8D37D0, 1, 0, true) -- Исправляет падение FPS когда камера направлена на воду. --------[fix spawn bottle or smoke]---------- memory.fill(0x4217F4, 0x90, 21, true) memory.fill(0x4218D8, 0x90, 17, true) memory.fill(0x5F80C0, 0x90, 10, true) memory.fill(0x5FBA47, 0x90, 10, true) --------------------------------------------- writeMemory(0x522DBE, 2, 0x09EB, true)--interior cam fix (thanks air) original (0974) = (09EB) end if fnc == "SetPriorityClass" then local index = selectedPriorityIndex[0] + 1 local priority = priorityClasses[index] local process = ffi.C.GetCurrentProcess() ffi.C.SetPriorityClass(process, priority.value) end if fnc == "updateWindow" then --[[local RwD3D9ChangeMultiSamplingLevels = ffi.cast("int(__cdecl*)(int)", 0x7F8A90) RwD3D9ChangeMultiSamplingLevels(readMemory(0x8E2430, 4, true))]] end if fnc == "KillList" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.KillListChange then writeMemory(sampBase()+0xD7FD4, 4, representFloatAsInt(config.ini.settings.KillListPosX), true) writeMemory(sampBase()+0xD7FD8, 4, representFloatAsInt(config.ini.settings.KillListPosY), true) else if fnc ~= "all" then writeMemory(sampBase()+0xD7FD4, 4, representFloatAsInt(0.75), true) writeMemory(sampBase()+0xD7FD8, 4, representFloatAsInt(0.300), true) end end elseif get_samp_version() == "r3" then if config.ini.settings.KillListChange then writeMemory(sampBase()+0xEA2F4, 4, representFloatAsInt(config.ini.settings.KillListPosX), true) writeMemory(sampBase()+0xEA2F8, 4, representFloatAsInt(config.ini.settings.KillListPosY), true) else if fnc ~= "all" then writeMemory(sampBase()+0xEA2F4, 4, representFloatAsInt(0.75), true) writeMemory(sampBase()+0xEA2F8, 4, representFloatAsInt(0.300), true) end end end end if fnc == "NetStatsWithHud" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.NetStatsWithHud then writeMemory(sampBase() + 0x7137F, 4, 0x90909090, true) writeMemory(sampBase() + 0x7137F+4, 4, 0x90909090, true) writeMemory(sampBase() + 0x7137F+8, 4, 0x90909090, true) writeMemory(sampBase() + 0x7137F+12, 1, 0x90, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x7137F, 4, 0xA10C0D8B, true) writeMemory(sampBase() + 0x7137F+4, 4, 0x6A03BC, true) writeMemory(sampBase() + 0x7137F+8, 4, 0x2BF84E8, true) writeMemory(sampBase() + 0x7137F+12, 1, 0x00, true) end end elseif get_samp_version() == "r3" then if config.ini.settings.NetStatsWithHud then writeMemory(sampBase() + 0x7526F, 4, 0x90909090, true) writeMemory(sampBase() + 0x7526F+4, 4, 0x90909090, true) writeMemory(sampBase() + 0x7526F+8, 4, 0x90909090, true) writeMemory(sampBase() + 0x7526F+12, 1, 0x90, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x7526F, 4, 0xA10C0D8B, true) writeMemory(sampBase() + 0x7526F+4, 4, 0x6A03BC, true) writeMemory(sampBase() + 0x7526F+8, 4, 0x2BF84E8, true) writeMemory(sampBase() + 0x7526F+12, 1, 0x00, true) end end end end if fnc == "InputPatch" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.inputPatch then writeMemory(sampBase() + 0x6B9FB, 4, 0x90909090, true) writeMemory(sampBase() + 0x6B9FB+4, 1, 0x90, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x6B9FB, 4, 0xFF9EE0E8, true) writeMemory(sampBase() + 0x6B9FB+4, 1, 0xFF, true) end end elseif get_samp_version() == "r3" then if config.ini.settings.inputPatch then writeMemory(sampBase() + 0x6F8FB, 4, 0x90909090, true) writeMemory(sampBase() + 0x6F8FB+4, 1, 0x90, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x6F8FB, 4, 0xFF9EE0E8, true) writeMemory(sampBase() + 0x6F8FB+4, 1, 0xFF, true) end end end end ----------------------------------------------------------------------- if fnc == "OpenMenu" then UI.main[0] = not UI.main[0] end if fnc == "OpenTws" then UI.tws[0] = not UI.tws[0] end if fnc == "OpenTimecycCreator" then UI.tcyc[0] = not UI.tcyc[0] end if fnc == "GTATime" then writeMemory(0xB7015C, 4, config.ini.settings.miliseconds, true)--c ms time if config.ini.settings.gtatime then writeMemory(0x52CF10, 1, 0x51, true) else writeMemory(0x52CF10, 1, 0xC3, true) end setTimeOfDay(config.ini.settings.hours, config.ini.settings.min) end if fnc == "GTAWeather" then local function getMilliseconds() local _, b = math.modf(os.clock()) return ("%03d"):format(b * 1000) end if config.ini.settings.gtaweather then math.randomseed(os.time()) forceWeatherNow(math.random(0, 28)) writeMemory(0x72A510, 1, 0x66, false) -- Отключаем дождливую погоду if config.ini.settings.noRain then local offsets = {} -- Округ offsets = {0x2C, 0x2D, 0x2E, 0x2F} for i = 1, 4 do memory.setint8(0x8D5EB0 + offsets[i], 15, true) end -- ЛС memory.setint8(0x8D5EF0 + 0x2E, 0, true) -- СФ offsets = {0x12, 0x13, 0x2D, 0x2E} for i = 1, 4 do memory.setint8(0x8D5F30 + offsets[i], 7, true) end end -- Отключаем туманную погоду if config.ini.settings.noFog then local offsets = {} -- Округ offsets = {0xA, 0xB, 0x29, 0x2A} for i = 1, 4 do memory.setint8(0x8D5EB0 + offsets[i], 15, true) end -- СФ offsets = {0x7, 0x8, 0x1E, 0x1F, 0x31, 0x32} for i = 1, 6 do memory.setint8(0x8D5F30 + offsets[i], 7, true) end end -- Отключаем пустынную бурю if config.ini.settings.noSandstorm then local offsets = {0x3, 0x4, 0x25, 0x26, 0x27, 0x3C, 0x3D, 0x3E} for i = 1, 8 do memory.setint8(0x8D5FB0 + offsets[i], 18, true) end end CWeather__ReleaseWeather() math.randomseed(os.time() * getMilliseconds()) memory.setint8(0xC81310, math.random(0, 63), false) -- CWeather::WeatherTypeInList else writeMemory(0x72A510, 1, 0xC3, false) end end if fnc == "BlockWeather" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.blockweather then writeMemory(sampBase() + 0x9C130, 4, 0x0004C2, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x9C130, 4, 0x5D418B, true) end end elseif get_samp_version() == "r3" then if config.ini.settings.blockweather then writeMemory(sampBase() + 0xA0430, 4, 0x0004C2, true) else if fnc ~= "all" then writeMemory(sampBase() + 0xA0430, 4, 0x5D418B, true) end end end end if fnc == "SetTime" or fnc == "all" then Im.Hours = config.ini.settings.hours Im.Mins = config.ini.settings.min setTimeOfDay(config.ini.settings.hours, config.ini.settings.min) end if fnc == "SetWeather" or fnc == "all" then Im.CurrWeather[0] = config.ini.settings.weather forceWeatherNow(config.ini.settings.weather) end if fnc == "SetPlayersDist" or fnc == "all" then writeMemory(0xFDFEEC+933, 4, representFloatAsInt(config.ini.settings.playersDist), true) writeMemory(0x73295C + 2, 4, 0xFDFEEC+933, true) end if fnc == "SetWeaponDist" or fnc == "all" then writeMemory(0xDEECAE+350, 4, representFloatAsInt(config.ini.settings.drawweapondist), true) writeMemory(0x7336A8 +2, 4, 0xDEECAE+350, true) end if fnc == "BlockTime" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.blocktime then writeMemory(sampBase() + 0x9C0A0, 4, 0x000008C2, true) else if fnc ~= "all" then writeMemory(sampBase() + 0x9C0A0, 4, 0x0824448B, true) end end elseif get_samp_version() == "r3" then if config.ini.settings.blocktime then writeMemory(sampBase() + 0xA03A0, 4, 0x000008C2, true) else if fnc ~= "all" then writeMemory(sampBase() + 0xA03A0, 4, 0x0824448B, true) end end end end if fnc == "StaticLight" or fnc == "all" then local brValue = config.ini.effects_manager.postfx and 1.4 or 0.56 writeMemory(0xFF7377, 4, representFloatAsInt(brValue), true) if config.ini.settings.staticLight then writeMemory(0x5603B6+2, 4, 0xFF7377, true) writeMemory(0x560396+2, 4, 0xFF7377, true) writeMemory(0x5603A6+2, 4, 0xFF7377, true) else writeMemory(0x5603B6+2, 4, 0xB7C4C0, true) writeMemory(0x560396+2, 4, 0xB7C4B8, true) writeMemory(0x5603A6+2, 4, 0xB7C4BC, true) end end if fnc == "FixTimecyc" or fnc == "all" then if config.ini.fixtimecyc.active then memory.write(6359759, 144, 1, false) memory.write(6359760, 144, 1, false) memory.write(6359761, 144, 1, false) memory.write(6359762, 144, 1, false) memory.write(6359763, 144, 1, false) memory.write(6359764, 144, 1, false) memory.write(6359778, 144, 1, false) memory.write(6359779, 144, 1, false) memory.write(6359780, 144, 1, false) memory.write(6359781, 144, 1, false) memory.write(6359782, 144, 1, false) memory.write(6359783, 144, 1, false) memory.write(6359784, 144, 1, false) memory.write(6359785, 144, 1, false) memory.write(6359786, 144, 1, false) memory.write(6359787, 144, 1, false) memory.write(5637016, 12044024, 4, false) memory.write(5637032, 12044024, 4, false) memory.write(5637048, 12044024, 4, false) memory.write(5636920, 12044048, 4, false) memory.write(5636936, 12044072, 4, false) memory.write(5636952, 12044096, 4, false) memory_setfloat(9228384, config.ini.fixtimecyc.allambient, false) memory_setfloat(12044024, config.ini.fixtimecyc.objambient, false) memory_setfloat(12044048, config.ini.fixtimecyc.worldambientR, false) memory_setfloat(12044072, config.ini.fixtimecyc.worldambientG, false) memory_setfloat(12044096, config.ini.fixtimecyc.worldambientB, false) else if fnc ~= "all" then memory.write(6359759, 217, 1, false) memory.write(6359760, 21, 1, false) memory.write(6359761, 96, 1, false) memory.write(6359762, 208, 1, false) memory.write(6359763, 140, 1, false) memory.write(6359764, 0, 1, false) memory.write(6359778, 199, 1, false) memory.write(6359779, 5, 1, false) memory.write(6359780, 96, 1, false) memory.write(6359781, 208, 1, false) memory.write(6359782, 140, 1, false) memory.write(6359783, 0, 1, false) memory.write(6359784, 0, 1, false) memory.write(6359785, 0, 1, false) memory.write(6359786, 128, 1, false) memory.write(6359787, 63, 1, false) memory.write(5637016, 12043448, 4, false) memory.write(5637032, 12043452, 4, false) memory.write(5637048, 12043456, 4, false) memory.write(5636920, 12043424, 4, false) memory.write(5636936, 12043428, 4, false) memory.write(5636952, 12043432, 4, false) end end end if fnc == "GivemeDist" or fnc == "all" then if config.ini.settings.givemedist then ---------------return original bytes------- hex2bin("8B0DF0C4B700", 0x53EA93, 6) hex2bin("DEC1D95E54", 0x55FCD9, 5) ------------------------------------------ memory.write(0x53EA95, 0xB7C7F0, 4, true) memory.write(0x7FE621, 0xC99F68, 4, true) else if fnc ~= "all" then memory.write(0x53EA95, 0xB7C4F0, 4, true) memory.write(0x7FE621, 0xC992F0, 4, true) end end end if fnc == "LodDist" or fnc == "all" then if config.ini.settings.givemedist then memory_setfloat(0xCFFA11, config.ini.settings.lod, true) local aWrites = { [1] = 0x555172+2, [2] = 0x555198+2, [3] = 0x5551BB+2, [4] = 0x55522E+2, [5] = 0x555238+2, [6] = 0x555242+2, [7] = 0x5552F4+2, [8] = 0x5552FE+2, [9] = 0x555308+2, [10] = 0x555362+2, [11] = 0x55537A+2, [12] = 0x555388+2, [13] = 0x555A95+2, [14] = 0x555AB1+2, [15] = 0x555AFB+2, [16] = 0x555B05+2, [17] = 0x555B1C+2, [18] = 0x555B2A+2, [19] = 0x555B38+2, [20] = 0x555B82+2, [21] = 0x555B8C+2, [22] = 0x555B9A+2, [23] = 0x5545E6+2, [24] = 0x554600+2, [25] = 0x55462A+2, [26] = 0x5B527A+2, } for i = 0, #aWrites do writeMemory(aWrites[i], 4, 0xCFFA11, true) end end end if fnc == "ShadowEdit" or fnc == "all" then if config.ini.settings.shadowedit then memory.write(0x55FC61, 0, 1, true) memory.write(0x55FCBB, 0, 1, true) memory.setint32(0xB7C4E8, config.ini.settings.shadowcp, true) memory.setint32(0xB7C4EC, config.ini.settings.shadowlight, true) else if fnc ~= "all" then memory.write(0x55FC61, 72, 1, true) memory.write(0x55FCBB, 76, 1, true) end end end if fnc == "NoShadows" or fnc == "all" then --reset shadow for shadow asi shader fix hex2bin('E838A21C00', 0x53E0C3, 5) hex2bin('E893C81C00', 0x53E0C8, 5) hex2bin('E87D9E1C00', 0x53E0BE, 5) if config.ini.settings.pedshadows then writeMemory(0x707B40, 1, 0xC3, true)--отключает тень под скином else if fnc ~= "all" then writeMemory(0x707B40, 1, 0x83, true)--включает тень под скином end end if config.ini.settings.vehshadows then --отключает тень под транспортом memory.fill(0x6ABCF5, 0x90, 5, true) memory.fill(0x6BD667, 0x90, 5, true) memory.fill(0x6C0B21, 0x90, 5, true) memory.fill(0x6C58A0, 0x90, 5, true) memory.fill(0x6CA73A, 0x90, 5, true) else if fnc ~= "all" then hex2bin('E8A6000600', 0x6ABCF5, 5) hex2bin('E834E70400', 0x6BD667, 5) hex2bin('E87AB20400', 0x6C0B21, 5) hex2bin('E8FB640400', 0x6C58A0, 5) hex2bin('E861160400', 0x6CA73A, 5) end end if config.ini.settings.poleshadows then writeMemory(0x70C750, 1, 0xC3, true)--отключает тени под столбами else if fnc ~= "all" then writeMemory(0x70C750, 1, 0x83, true)--включает тени под столбами end end if config.ini.settings.bestshadows then writeMemory(0x0053E159, 1, 0xC3, true) else if fnc ~= "all" then writeMemory(0x0053E159, 1, 0xE9, true) end end end if fnc == "FPSUnlock" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.unlimitfps then memory.write(sampBase() + 0x9D9D1, 0x8B, 1, true) else memory.write(sampBase() + 0x9D9D1, 0x9B, 1, true) end elseif get_samp_version() == "r3" then if config.ini.settings.unlimitfps then memory.write(sampBase() + 0xA1F60, 0x5051FF15, 4, true) else memory.write(sampBase() + 0xA1F60, 0xFFF57BE8, 4, true) end end end if fnc == "NoWind" or fnc == "all" then writeMemory(0x506667+1, 4, config.ini.settings.nowind and 0xB72914 or 0x8E26DC, true) writeMemory(0x505BEB+1, 4, config.ini.settings.nowind and 0xB72914 or 0x8E26DC, true) writeMemory(0x505377+2, 4, config.ini.settings.nowind and 0xB72914 or 0x8E26DC, true) end if fnc == "MenuPauseSound" or fnc == "all" then if config.ini.settings.MenuPauseSound then writeMemory(0x4DD4A0, 4, 0x3B68FF6A, true) --0x3B68FF6A ? 0x000CC2 else writeMemory(0x4DD4A0, 4, 0x000CC2, true) --0x3B68FF6A ? 0x000CC2 end end if fnc == "BladeSound" or fnc == "all" then writeMemory(0x6DB863, 2, config.ini.settings.bladeSound and 0x0D77 or 0x9090, true) end if fnc == "HeliEngineSound" or fnc == "all" then writeMemory(0xB6B994, 1, config.ini.settings.heliEngineSound and 0 or 1, true) end if fnc == "EffectsManager" or fnc == "all" then hex2bin(config.ini.effects_manager.MotionBlur and "E811E2FFFF" or "9090909090", 0x704E8A, 5) writeMemory(0x8D5104, 1, config.ini.effects_manager.MotionBlurIntensity, true) writeMemory(0xCFEDAF+1384, 4, representFloatAsInt(config.ini.effects_manager.vehspec and 0.0 or 1.85), true) writeMemory(0x5D990A+2, 4, 0xCFEDAF+1384, true) if config.ini.effects_manager.noPointLight then writeMemory(0x7000E0, 1, 0xC3, true) else if fnc ~= "all" then writeMemory(0x7000E0, 1, 0x8B, true) end end if config.ini.effects_manager.noRainyFog then writeMemory(0x72ADB7 , 2, 0x9090, true) --0x0875 else if fnc ~= "all" then writeMemory(0x72ADB7 , 2, 0x0875, true) --0x0875 end end if config.ini.effects_manager.noweatherflash then writeMemory(0x53EA17+1, 4, 0x8CC2D7, true)--небо writeMemory(0x73557A+1, 4, 0x8CC2D7, true)--окружение else if fnc ~= "all" then writeMemory(0x53EA17+1, 4, 0xC812CC, true)--небо writeMemory(0x73557A+1, 4, 0xC812CC, true)--окружение end end if config.ini.effects_manager.noplaneline then memory.fill(0x7178F0, 0x90, 5, true) else if fnc ~= "all" then hex2bin('E9ABFAFFFF', 0x7178F0, 5) end end if config.ini.effects_manager.fireworld then writeMemory(0x539F00, 4, 0x0024C2, true)-- отключить огонь, вкл 0x6C8B5551 else if fnc ~= "all" then writeMemory(0x539F00, 4, 0x6C8B5551, true)-- отключить огонь, вкл 0x6C8B5551 end end if config.ini.effects_manager.tiretracks then memory.fill(0x53E175, 0x90, 5, true) else if fnc ~= "all" then hex2bin('E8C6241E00', 0x53E175, 5) end end if config.ini.effects_manager.nobirds then memory.fill(0x712833, 0x90, 2, true) else if fnc ~= "all" then hex2bin('3BC5', 0x712833, 2) --nobirds end end if config.ini.effects_manager.nocloudbig then memory.write(5497268, -1869574000, 4, true)--высокие густые облака выкл memory.write(5497272, 144, 1, true)--высокие густые облака выкл else if fnc ~= "all" then memory.write(5497268, 495044584, 4, true)--высокие густые облака вкл memory.write(5497272, 0, 1, true)--высокие густые облака вкл end end if config.ini.effects_manager.nocloudsmall then memory.fill(5497121, 144, 5, true)--низкие облака выкл else if fnc ~= "all" then memory.write(5497121, 494111464, 4, true)--низкие облака вкл memory.write(5497125, 0, 1, true)--низкие облака вкл end end if config.ini.effects_manager.nocloudhorizont then writeMemory(0x70EAB0, 1, 0xC3, true)-- disable horizont clouds original byte 0x83 else if fnc ~= "all" then writeMemory(0x70EAB0, 1, 0x83, true)-- disable horizont clouds original byte 0x83 end end if config.ini.effects_manager.postfx then memory.write(7358318, 2866, 4, true)--postfx off memory.write(7358314, -380152237, 4, true)--postfx off writeMemory(0x53E227, 1, 0xC3, true) gotofunc("StaticLight") else if fnc ~= "all" then memory.write(7358318, 1448280247, 4, true)--postfx on memory.write(7358314, -988281383, 4, true)--postfx on writeMemory(0x53E227, 1, 0xE9, true) end gotofunc("StaticLight") end if config.ini.effects_manager.reflectionwater then memory_setfloat(0xCDFDDA, 0, true) writeMemory(0x6FBAE4+2, 4, 0xCDFDDA, true) else if fnc ~= "all" then memory_setfloat(0xCDFDDA, 0.3, true) writeMemory(0x6FBAE4+2, 4, 0xCDFDDA, true) end end if config.ini.effects_manager.nomorehaze then writeMemory(0x72C1B7, 1, 0xEB, true) else if fnc ~= "all" then writeMemory(0x72C1B7, 1, 0x7C, true) end end if config.ini.effects_manager.nosparks then writeMemory(0x49F040, 4, 0x0028C2, true) -- отключить искры else if fnc ~= "all" then writeMemory(0x49F040, 4, 0xF683E7E9, true) -- включить искры end end if config.ini.effects_manager.nowaterfog then writeMemory(0x6E7760, 1, 0xC3, true) else if fnc ~= "all" then writeMemory(0x6E7760, 1, 0xA0, true) end end if config.ini.effects_manager.breakobject then writeMemory(0x59DE40, 4, 0x0010C2, true) -- отключить пыль при поломке обьектов else if fnc ~= "all" then writeMemory(0x59DE40, 4, 0x5358EC83, true) -- включить пыль при поломке обьектов end end if config.ini.effects_manager.nogunfire then writeMemory(0x5DF340, 4, 0x0008C2, true)-- отключить огонь при выстрелах else if fnc ~= "all" then writeMemory(0x5DF340, 4, 0x8BF18B56, true)-- вкючить огонь при выстрелах end end if config.ini.effects_manager.nogunsmoke then writeMemory(0x4A0DE0, 4, 0x0010C2, true) -- отключить дым при выстреле else if fnc ~= "all" then writeMemory(0x4A0DE0, 4, 0xB6F03CA1, true) -- включить дым при выстреле end end if config.ini.effects_manager.nofxsystem then memory.fill(0x4A125D, 0x90, 8, true) -- 8B 4E 08 E8 47 91 00 00 FxSystem_c::Play(void) else if fnc ~= "all" then hex2bin('8B4E08E88B900000', 0x4A125D, 8) --FxSystem_c::Play(void) end end if config.ini.effects_manager.noblood then memory.fill(0x49EB23, 0x90, 2, true)-- blood particle else if fnc ~= "all" then hex2bin('EB05', 0x49EB23, 2)-- blood particle end end if config.ini.effects_manager.swim then memory.write(0x68AA70, 0x0004C2, 4, true) -- process swim effects ped memory.write(0x6C399F+1, 0, 4, true)--addsplashparticles memory.write(0x6C3606+1, 0, 4, true)-- капли при ходьбе memory.write(0x4A1144, 0x0004C2, 4, true)-- брызги воды когда в неё стреляют memory.write(0x4A10D4, 0x0004C2, 4, true)-- water_splash memory.write(0x4A11B4, 0x0004C2, 4, true) writeMemory(0x6DD130, 4, 0x0004C2, true)-- boat splash брызги воды от водного транспорта writeMemory(0x6ED9A0, 4, 0xC3, true)--бурун от водного транспорта else if fnc ~= "all" then memory.write(0x68AA70, -1587216534, 4, true) memory.write(0x6C399F+1, 1053609165, 4, true) memory.write(0x6C3606+1, 1045220557, 4, true) memory.write(0x4A1144, 9603048, 4, true)-- брызги воды когда в неё стреляют memory.write(0x4A10D4, 9631720, 4, true)-- water_splash memory.write(0x4A11B4, 9574376, 4, true) writeMemory(0x6DD130, 4, 0x80EC81, true)-- boat splash брызги воды от водного транспорта writeMemory(0x6ED9A0, 4, 0x83EC8B55, true)--бурун от водного транспорта end end if config.ini.effects_manager.noexhaust then memory.fill(0x6AB344, 0x90, 5, true) memory.fill(0x6BD3FF, 0x90, 5, true) else if fnc ~= "all" then hex2bin("E8F72E0300", 0x6AB344, 5)-- дым из труб транспорта hex2bin("E83C0E0200", 0x6BD3FF, 5) end end if config.ini.effects_manager.noSmokeCplane then writeMemory(0x6CBEFE+1, 4, 0, true)--disable cplane smoke else if fnc ~= "all" then writeMemory(0x6CBEFE+1, 4, 0x3E4CCCCD, true)--disable cplane smoke end end if config.ini.effects_manager.wheelsand then writeMemory(0x4A06F5+1, 4, 0, true) -- песок из под колес memory.write(0x4A0630, 0x9090, 2, true)-- песок else if fnc ~= "all" then writeMemory(0x4A0AA0+1, 4, 0x3F800000, true) -- пыль из под колес memory.write(0x4A0630, 0x05EB, 2, true)-- песок end end if config.ini.effects_manager.wheeldust then writeMemory(0x6DEF50+1, 4, 0, true) -- пыль из под колес memory.write(0x4A09E0, 0x9090, 2, true)-- пыль else if fnc ~= "all" then writeMemory(0x6DEF50+1, 4, 0x9A99993E, true) -- пыль из под колес memory.write(0x4A09E0, 0x05EB, 2, true)-- пыль end end if config.ini.effects_manager.wheelmud then writeMemory(0x4A0003+1, 4, 0, true) -- грязь из под колес writeMemory(0x4A04A3+1, 4, 0, true) -- грязь из под колес x2 memory.write(0x4A040E, 0x9090, 2, true) -- грязь else if fnc ~= "all" then writeMemory(0x4A0003+1, 4, 0x3F800000, true) -- грязь из под колес writeMemory(0x4A04A3+1, 4, 0x3F800000, true) -- грязь из под колес x2 memory.write(0x4A040E, 0x05EB, 2, true) -- грязь end end if config.ini.effects_manager.wheelgravel then writeMemory(0x4A0253+1, 4, 0, true) -- гравий из под колес memory.write(0x4A01BE, 0x9090, 2, true) -- гравий else if fnc ~= "all" then writeMemory(0x4A0253+1, 4, 0x3F800000, true) -- гравий из под колес memory.write(0x4A01BE, 0x05EB, 2, true) -- гравий end end if config.ini.effects_manager.wheelgrass then memory.write(0x49FF6E, 0x9090, 2, true) -- трава else if fnc ~= "all" then memory.write(0x49FF6E, 0x05EB, 2, true) -- трава end end if config.ini.effects_manager.wheelspray then memory.write(0x49FB50, 0x9090, 2, true) -- дым writeMemory(0x6DF1C3+1, 4, 0, true) -- дым из под колес writeMemory(0x6DF1BE+1, 4, 0, true) -- дым из под колес writeMemory(0x6DED24+1, 4, 0, true) -- дым при дрифте, W+S writeMemory(0x6DED1A+1, 4, 0, true) else if fnc ~= "all" then memory.write(0x49FB50, 0x05EB, 2, true) -- дым writeMemory(0x6DF1C3+1, 4, 0x3F800000, true) -- дым из под колес writeMemory(0x6DF1BE+1, 4, 0x3F000000, true) -- дым из под колес writeMemory(0x6DED24+1, 4, 0x3F333333, true) -- дым при дрифте, W+S writeMemory(0x6DED1A+1, 4, 0x3E99999A, true) end end if config.ini.effects_manager.vehsparks then memory_setfloat(0xCB0870, -99.9, true) -- искры при царапании транспорта memory.write(0x5458DA+2, 0xCB0870, 4, true) else if fnc ~= "all" then memory_setfloat(0xCB0870, 0.0000118509, true) -- искры при царапании транспорта memory.write(0x5458DA+2, 0xCB0870, 4, true) end end if config.ini.effects_manager.vehdust then writeMemory(0x6C9FAF+1, 4, 0, true)-- пыль при взлете от воздушного транспотрта plane writeMemory(0x6C55F4+1, 4, 0, true)--пыль при взлете от воздушного транспотрта heli else if fnc ~= "all" then writeMemory(0x6C9FAF+1, 4, 0x40000000, true)-- пыль при взлете от воздушного транспотрта plane writeMemory(0x6C55F4+1, 4, 0x3F800000, true)--пыль при взлете от воздушного транспотрта heli end end if config.ini.effects_manager.vehdmgdust then writeMemory(0x6A6E93+1, 4, 0, true)--пыль при столкновении транспорта с объектами else if fnc ~= "all" then writeMemory(0x6A6E93+1, 4, 0x3DCCCCCD, true)--пыль при столкновении транспорта с объектами end end if config.ini.effects_manager.footdust then writeMemory(0x5E3811+1, 4, 0, true)--foot dust writeMemory(0x5458E0+1, 4, 0, true) else if fnc ~= "all" then writeMemory(0x5E3811+1, 4, 0x3E19999A, true)--foot dust writeMemory(0x5458E0+1, 4, 0x3DCCCCCD, true) end end if config.ini.effects_manager.nodust then writeMemory(0x49F57D+1, 4, 0, true) -- пыль при выстреле в песок writeMemory(0x49F49D+1, 4, 0, true) -- пыль при столкновении пули с поверхностью, бетон, дорога и т.д else if fnc ~= "all" then writeMemory(0x49F57D+1, 4, 0x3ECCCCCD, true) -- пыль при выстреле в песок writeMemory(0x49F49D+1, 4, 0x3D99999A, true) -- пыль при столкновении пули с поверхностью, бетон, дорога и т.д end end if config.ini.effects_manager.gunshell then writeMemory(0x73A40A, 2, 0x9090, true)--гильзы else if fnc ~= "all" then writeMemory(0x73A40A, 2, 0x0375, true)--гильзы end end if config.ini.effects_manager.teargas then writeMemory(0x00872BF0, 1, 0xC3, false) else if fnc ~= "all" then writeMemory(0x00872BF0, 1, 0x74, false) end end if config.ini.effects_manager.footprints then writeMemory(0x005E559C+1, 4, -1, true)-- следы ног на песке (footprints in the sand) else if fnc ~= "all" then writeMemory(0x005E559C+1, 4, 0x40800000, true)-- следы ног на песке (footprints in the sand) end end if config.ini.effects_manager.vehdmgsmoke then writeMemory(0x6D2A80, 4, 0xC3, true)--smoke dmg vehicles else if fnc ~= "all" then writeMemory(0x6D2A80, 4, 0x5618EC83, true)--smoke dmg vehicles end end if config.ini.effects_manager.vehtaxilight then memory.write(12697552, 0, 1, true)--выключает свечение шашки такси else if fnc ~= "all" then memory.write(12697552, 1, 1, true)--включает свечение шашки такси end end checkboxes.vehtaxilight[0] = config.ini.effects_manager.vehtaxilight end if fnc == "ShowHUD" or fnc == "all" then if preset["Other"]["showhud"] then displayHud(false) memory.setint8(0xBA676C, 2) else if fnc ~= "all" then displayHud(true) memory.setint8(0xBA676C, 0) end end end if fnc == "ScreenOptions" or fnc == "all" then if config.ini.settings.aspectratio_status then writeMemory(0xFCFAED, 4, representFloatAsInt(config.ini.settings.aspectratio, false)) writeMemory(0x6FF43F+2, 4, 0xFCFAED, false) writeMemory(0x6FF43D, 2, 0x9090, false) else writeMemory(0x6FF43F+2, 4, 0x008595F0, false) end end if fnc == "FixLoadMap" or fnc == "all" then --[[ 00584C6D 3B D0 cmp edx, eax 00584C6F 7C 64 jl short loc_584CD5 00584C71 41 inc ecx 00584C72 3B D1 cmp edx, ecx 00584C74 7F 5F jg short loc_584CD5 00584C76 8B 44 24 1C mov eax, [esp+14h+arg_4] 00584C7A 8D 48 FF lea ecx, [eax-1] 00584C7D 3B D9 cmp ebx, ecx 00584C7F 7C 54 jl short loc_584CD5 00584C81 40 inc eax 00584C82 3B D8 cmp ebx, eax 00584C84 7F 4F ]] if preset["MenuPause"]["fixloadmap"] then memory.fill(0x584C6D, 0x90, 0x19, true)-- fixloadmap else if fnc ~= "all" then hex2bin('3BD07C64413BD17F5F8B44241C8D48FF3BD97C54403BD87F4F', 0x584C6D, 0x19) end end end if fnc == "ShowCHAT" or fnc == "all" then if get_samp_version() == "r1" then if preset["Other"]["showchat"] then memory.write(sampBase() + 0x7140F, 1, 1, true) sampSetChatDisplayMode(0) else memory.write(sampBase() + 0x7140F, 0, 1, true) sampSetChatDisplayMode(3) end elseif get_samp_version() == "r3" then if preset["Other"]["showchat"] then memory.write(sampBase() + 0x752FF, 1, 1, true) sampSetChatDisplayMode(0) else memory.write(sampBase() + 0x752FF, 0, 1, true) sampSetChatDisplayMode(3) end end end if fnc == "ShowHP" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.showhp then memory.setint16(sampBase() + 0x6FC30, 0xC390, true) else memory.setint16(sampBase() + 0x6FC30, 0x8B55, true) end elseif get_samp_version() == "r3" then if config.ini.settings.showhp then memory.setint16(sampBase() + 0x73B20, 0xC390, true) else memory.setint16(sampBase() + 0x73B20, 0x8B55, true) end end end if fnc == "ShowNICKS" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.shownicks then memory.setint16(sampBase() + 0x70D40, 0xC390, true) else memory.setint16(sampBase() + 0x70D40, 0x8B55, true) end elseif get_samp_version() == "r3" then if config.ini.settings.shownicks then memory.setint16(sampBase() + 0x74C30, 0xC390, true) else memory.setint16(sampBase() + 0x74C30, 0x8B55, true) end end end if fnc == "InteriorRun" or fnc == "all" then if config.ini.settings.intrun then memory.write(5630064, -1027591322, 4, true) memory.write(5630068, 4, 2, true) else memory.write(5630064, 69485707, 4, true) memory.write(5630068, 1165, 2, true) end checkboxes.intrun[0] = config.ini.settings.intrun end if fnc == "FixWaterQuadro" or fnc == "all" then if config.ini.settings.waterfixquadro then memory_setfloat(13101856, 0.0, true) memory.write(7249056, 13101856, 4, true) memory.write(7249115, 13101856, 4, true) memory.write(7249175, 13101856, 4, true) memory.write(7249235, 13101856, 4, true) else memory.write(7249056, 8752012, 4, true) memory.write(7249115, 8752012, 4, true) memory.write(7249175, 8752012, 4, true) memory.write(7249235, 8752012, 4, true) end checkboxes.waterfixquadro[0] = config.ini.settings.waterfixquadro end if fnc == "FixLongArm" or fnc == "all" then if config.ini.settings.longarmfix then memory.write(7045634, 33807, 2, true) memory.write(7046489, 33807, 2, true) else memory.write(7045634, 59792, 2, true) memory.write(7046489, 59792, 2, true) end checkboxes.longarmfix[0] = config.ini.settings.longarmfix end if fnc == "FixBlackRoads" or fnc == "all" then if config.ini.settings.fixblackroads then memory.write(8931716, 0, 4, true) else memory.write(8931716, 2, 4, true) end checkboxes.fixblackroads[0] = config.ini.settings.fixblackroads end if fnc == "AudioStream" or fnc == "all" then if get_samp_version() == "r1" then if config.ini.settings.audiostream then memory.write(sampBase() + 104848, 9449, 2, true)-- включает аудиострим else memory.write(sampBase() + 104848, 50064, 2, true)-- выключает аудиострим end elseif get_samp_version() == "r3" then if config.ini.settings.audiostream then memory.write(sampBase() + 0x661F3, 14708, 2, true)-- включает аудиострим else memory.write(sampBase() + 0x661F3, 50064, 2, true)-- выключает аудиострим end end end if fnc == "InteriorMusic" or fnc == "all" then if config.ini.settings.intmusic then memory.write(5276752, -591647351, 4, true) memory.write(5276756, 182, 2, true) memory.write(5277719, -591647351, 4, true) memory.write(5277723, 182, 2, true) else memory.fill(5276752, 144, 6, true) memory.fill(5277719, 144, 6, true) end end if fnc == "NoSounds" or fnc == "all" then if config.ini.settings.sounds then callFunction(0x507440, 0, 0) writeMemory(0x4D89DB, 4, 0x498D03EB, true)--on sounds else callFunction(0x507430, 0, 0) writeMemory(0x4D89DB, 4, 0x3B1E9, true)--off sounds local bs = RakLuaBitStream.new() bs:emulIncomingRPC(42) end end if fnc == "NoRadio" or fnc == "all" then if config.ini.settings.noradio then memory.write(5159328, -1947628715, 4, true) else memory.write(5159328, -1962933054, 4, true) end end if fnc == "BlockSampKeys" or fnc == "all" then if config.ini.nop_samp_keys.key_PgUp_PgDn then writeMemory(sampBase() + ((get_samp_version() == "r1") and 0x63700 or 0x66B50), 1, 0xC3, true) else writeMemory(sampBase() + ((get_samp_version() == "r1") and 0x63700 or 0x66B50), 1, 0x56, true) end if config.ini.nop_samp_keys.key_F4 then memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x797E or 0x79A4), 0, true) else memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x797E or 0x79A4), 115, true) end if config.ini.nop_samp_keys.key_F7 then memory.fill(sampBase() + ((get_samp_version() == "r1") and 0x5D8AD or 0x60C4D), 0xC3, 1, true) else memory.write(sampBase() + ((get_samp_version() == "r1") and 0x5D8AD or 0x60C4D), 0x8B, 1, true) end if config.ini.nop_samp_keys.key_T then memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x5DB04 or 0x60EA4), 0xC3, true) memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x5DAFA or 0x60E9A), 0xC3, true) else memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x5DB04 or 0x60EA4), 0x852F7574, true) memory.setint8(sampBase() + ((get_samp_version() == "r1") and 0x5DAFA or 0x60E9A), 0x900A7490, true) end end if fnc == "SunFix" or fnc == "all" then if config.ini.settings.sunfix then hex2bin("E865041C00", 0x53C136, 5) else memory.fill(0x53C136, 0x90, 5, true) end checkboxes.sunfix[0] = config.ini.settings.sunfix end if fnc == "VehicleNames" or fnc == "all" then if config.ini.settings.vehiclenames then hex2bin("E8B2B2FFFF", 0x58FBE9, 5) --return draw vehicle names else hex2bin("9090909090", 0x58FBE9, 5) --return draw vehicle names end end if fnc == "AreaNames" or fnc == "all" then if config.ini.settings.areanames then hex2bin('E876FEFFFF', 0x5720A5, 5) writeMemory(0x58D540, 1, 0x74, true) else hex2bin('9090909090', 0x5720A5, 5) end end if fnc == "Reflections" or fnc == "all" then if config.ini.settings.reflections then writeMemory(0xC7C724, 4, 0, true) memory.fill(0x555854, 0x90, 5, true) --InterioRreflections else hex2bin('E897151D00', 0x555854, 5) writeMemory(0x7230C6, 2, 0x9090, true)--nop call _ZN4Fx_c12GetFxQualityEv end end if fnc == "TargetBlip" or fnc == "all" then if config.ini.settings.targetblip then memory.write(5497324, 116, 1, true) else memory.write(5497324, 235, 1, true) end end if fnc == "CleanMemory" then -- Функция очистки старых записей local function cleanOldTimestamps() local currentTime = os.clock() for i = #cleanMemoryTimestamps, 1, -1 do if currentTime - cleanMemoryTimestamps[i] > 1 then table.remove(cleanMemoryTimestamps, i) end end end -- Основная функция очистки памяти local safeClean = function() if isCleaning then return end -- Если уже идёт очистка, игнорируем новый вызов isCleaning = true local oldram = ("%d"):format(tonumber(get_memory())) -- Вызов функций с возможностью краша local success, err = pcall(function() callFunction(0x53C500, 1, 1, 1, 1) --callFunction(0x40D7C0, 1, 1, -1) --restream callFunction(0x53C810, 1, 1, 1) callFunction(0x40CF80, 0, 0) callFunction(0x4090A0, 0, 0) callFunction(0x5A18B0, 0, 0) callFunction(0x707770, 0, 0) callFunction(0x40CFD0, 0, 0) end) isCleaning = false -- Сбрасываем флаг после завершения очистки if not success then AddNotify(script_name .. "{FF0000} Ошибка при очистке памяти: " .. err, 3000, 560) return end local newram = ("%d"):format(tonumber(get_memory())) if config.ini.cleaner.cleaninfo then AddNotify(script_name .. "{FFFFFF} Памяти до: {dc4747}" .. oldram .. " МБ. {FFFFFF}Памяти после: {dc4747}" .. newram .. " МБ. {FFFFFF}Очищено: {dc4747}" .. (oldram - newram) .. " МБ. {FFFFFF}Лимит: {dc4747}"..tonumber(config.ini.cleaner.limit).." МБ.", 3000, 560) end end -- Проверка частоты вызовов local currentTime = os.clock() table.insert(cleanMemoryTimestamps, currentTime) cleanOldTimestamps() if #cleanMemoryTimestamps > 2 then -- Если вызовов более 2 за секунду, выполняем restream if not isCleaning then callFunction(0x40D7C0, 1, 1, -1) -- restream end -- Выводим предупреждение не чаще, чем раз в 10 секунд if currentTime - lastWarningTime >= 10 then AddNotify(script_name .. "{FFFFFF} Функция очистки памяти вызывается слишком часто. {dc4747}Возможно, игра скоро вылетит. Сохраните прогресс!", 5000, 560) lastWarningTime = currentTime -- Обновляем время последнего уведомления end else -- Вызов безопасной очистки, если нет блокировки pcall(safeClean) end end if fnc == "ForceAniso" or fnc == "all" then if config.ini.settings.forceaniso then if readMemory(0x730F9C, 1, true) ~= 0 then writeMemory(0x730F9C, 1, 0, true) end else if readMemory(0x730F9C, 1, true) ~= 1 then writeMemory(0x730F9C, 1, 1, true) end end checkboxes.forceaniso[0] = config.ini.settings.forceaniso end if fnc == "SetBrightness" or fnc == "all" then if config.ini.settings.givemebrightness then hex2bin("E9D200000090", 0x0074721C, 5)--gamma nop (улучшает четкость текстур за счет правильного применения яркости) memory.setint32(0xBA6784, config.ini.settings.brightness, true) local brightness = ffi.cast("float", readMemory(0xBA6784, 4, true) * 0.001953125) local CGamma__setGamma = ffi.cast("char (__thiscall*)(void*, float, char)", 0x747200) CGamma__setGamma(ffi.cast("void*", 0xC92134), brightness, true) end end if fnc == "SetDistNickNames" then if config.ini.settings.givemedistnames then if tonumber(config.ini.settings.nickdistance) > tonumber(memory_getfloat(0xFFFC90, true)) then memory_setfloat(sampGetServerSettingsPtr() + 39, memory_getfloat(0xFFFC90, true), true) else memory_setfloat(sampGetServerSettingsPtr() + 39, config.ini.settings.nickdistance) end else memory_setfloat(sampGetServerSettingsPtr() + 39, memory_getfloat(0xFFFC90, true), true) end end if fnc == "SetDistObjects" or fnc == "all" then local obj_list = { stolbs_and_fonars = { [1] = { id = 1283, sdist = 85 }, [2] = { id = 1262, sdist = 45 }, [3] = { id = 3516, sdist = 85 }, [4] = { id = 3855, sdist = 50 }, [5] = { id = 1278, sdist = 150 }, [6] = { id = 1290, sdist = 150 }, [7] = { id = 1307, sdist = 100 }, [8] = { id = 1308, sdist = 100 }, [9] = { id = 3459, sdist = 100 }, [10] = { id = 3463, sdist = 62 }, [11] = { id = 3503, sdist = 50 }, [12] = { id = 3854, sdist = 100 }, [13] = { id = 1226, sdist = 62 }, [14] = { id = 1223, sdist = 53 }, [15] = { id = 1231, sdist = 55 }, [16] = { id = 1232, sdist = 55 }, [17] = { id = 1284, sdist = 85 }, [18] = { id = 1294, sdist = 55 }, [19] = { id = 1315, sdist = 64 }, [20] = { id = 1350, sdist = 60 }, [21] = { id = 3853, sdist = 62 }, [22] = { id = 3875, sdist = 100 }, [23] = { id = 3460, sdist = 62 }, [24] = { id = 1297, sdist = 59 }, }, musor = { [1] = { id = 1265, sdist = 45 }, [2] = { id = 1440, sdist = 50 }, [3] = { id = 1230, sdist = 40 }, [4] = { id = 1438, sdist = 50 }, [5] = { id = 1220, sdist = 40 }, [6] = { id = 1221, sdist = 40 }, [7] = { id = 1264, sdist = 45 }, [8] = { id = 1224, sdist = 41 }, [9] = { id = 910, sdist = 30 }, [10] = { id = 926, sdist = 30 }, [11] = { id = 928, sdist = 30 }, [12] = { id = 1372, sdist = 70 }, [13] = { id = 1357, sdist = 60 }, [14] = { id = 3594, sdist = 80 }, [15] = { id = 3593, sdist = 80 }, [16] = { id = 955, sdist = 30 }, [17] = { id = 760, sdist = 50 }, [18] = { id = 682, sdist = 80 }, [19] = { id = 17592, sdist = 80 }, [20] = { id = 1415, sdist = 50 }, }, } if config.ini.settings.givemedistobj then for k, v in pairs(obj_list.stolbs_and_fonars) do memory_setfloat(getMDO(obj_list.stolbs_and_fonars[k]["id"]), config.ini.settings.distobjects_stolb_fonars, true) end for k, v in pairs(obj_list.musor) do memory_setfloat(getMDO(obj_list.musor[k]["id"]), config.ini.settings.distobjects_musor, true) end for k, v in pairs(objdists) do if v ~= nil then local id_obj = v:match("^(%d+).-$") local dist_obj = v:match("^.-([-+]?%d+)$") memory_setfloat(getMDO(tonumber(id_obj)), tonumber(dist_obj), true) end end else for k, v in pairs(obj_list.stolbs_and_fonars) do memory_setfloat(getMDO(obj_list.stolbs_and_fonars[k]["id"]), obj_list.stolbs_and_fonars[k]["sdist"], true) end for k, v in pairs(obj_list.musor) do memory_setfloat(getMDO(obj_list.musor[k]["id"]), obj_list.musor[k]["sdist"], true) end end end if fnc == "MenuImage" or fnc == "all" then if preset["MenuPause"]["fullmenuimage"] then memory_setfloat(0x57B7EF, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B80B, preset["MenuPause"]["fullmenuheight"], true) memory_setfloat(0x57B852, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B862, preset["MenuPause"]["fullmenuheight"], true) memory_setfloat(0x57B877, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B88F, 320.0, true) memory_setfloat(0x57B8A9, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B8BD, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B8D5, preset["MenuPause"]["fullmenuheight"], true) memory_setfloat(0x57B917, preset["MenuPause"]["fullmenuwidth"], true) memory_setfloat(0x57B927, preset["MenuPause"]["fullmenuheight"], true) else memory_setfloat(0x57B7EF, 256.0, true) memory_setfloat(0x57B80B, 256.0, true) memory_setfloat(0x57B852, 256.0, true) memory_setfloat(0x57B862, 256.0, true) memory_setfloat(0x57B877, 128.0, true) memory_setfloat(0x57B88F, 128.0, true) memory_setfloat(0x57B8A9, 256.0, true) memory_setfloat(0x57B8BD, 256.0, true) memory_setfloat(0x57B8D5, 256.0, true) memory_setfloat(0x57B917, 300.0, true) memory_setfloat(0x57B927, 200.0, true) end end if fnc == "FixBloodWood" or fnc == "all" then if config.ini.settings.fixbloodwood then writeMemory(0x49EE63+1, 4, 0, true)--fix blood wood else writeMemory(0x49EE63+1, 4, 0x3F800000, true)--fix blood wood end end if fnc == "EditCrosshair" or fnc == "all" then if preset["Crosshair"]["nocrosshaireditsize"] then writeMemory(0x609D80, 2, 0x9090, true) else writeMemory(0x609D80, 2, 0x087A, true) end writeMemory(0xCADEDE+1083, 4, representFloatAsInt(preset["Crosshair"]["crosshairSizeX"]), true) writeMemory(0xCADEDE+1088, 4, representFloatAsInt(preset["Crosshair"]["crosshairSizeY"]), true) writeMemory(0x58E307,4, 0xCADEDE+1083, true) writeMemory(0x58E321,4, 0xCADEDE+1088, true) end if fnc == "SetDistLodVeh" or fnc == "all" then memory_setfloat(0xCB0900, config.ini.settings.vehloddist, true) memory.write(0x732924+2, 0xCB0900, 4, true) end if fnc == "HelpText" or fnc == "all" then if preset["MenuPause"]["helptext"] then memory.fill(0x57E3AE, 0x90, 5, true)-- подсказки else hex2bin("E86DC41900", 0x57E3AE, 5) end end if fnc == "BeginMenu" or fnc == "all" then if preset["MenuPause"]["beginmenu"] then memory.fill(0x579698, 0x90, 5, true) else hex2bin("E863101A00", 0x579698, 5) end end if fnc == "TreePitching" or fnc == "all" then if config.ini.settings.treepitching then memory.fill(0x535030, 0x90, 5, true) -- disable wind effects else hex2bin("E8DBB82B00", 0x535030, 5) end end if fnc == "OvalityCorrection" or fnc == "all" then writeMemory(0x70CEEF, 1, config.ini.settings.ovalityCorrection and 1 or 0, true)-- фиксит луну и прочую фигню что должно быть круглым. end if fnc == "SwimFix" or fnc == "all" then local prog = tcc.cdef[[ #include #include #include void swimFixLogic(uintptr_t esp) { float pCTimer__ms_fTimeStep = *(float*)0xB7CB5C; float magic = 1.0f / (pCTimer__ms_fTimeStep / (50.0f / 30.0f)); *(float*)(esp + 0x18) *= magic * 1.11; *(float*)(esp + 0x1C) *= magic * 1.11; *(float*)(esp + 0x20) *= magic * 1.11; } void __naked swimFix() { asm(R"( push %eax push %ecx push %edx mov %esp, %eax add $0xC, %eax push %eax call swimFixLogic add $4, %esp pop %edx pop %ecx pop %eax fld %st(1) fmuls (%eax) fld %st(2) jmp 0x0068A514 )"); } void installHook() { uintptr_t hook_addr = 0x68A50E; DWORD oldProt; VirtualProtect((void*)hook_addr, 6, PAGE_EXECUTE_READWRITE, &oldProt); *(uint8_t*)hook_addr = 0xE9; *(uintptr_t*)(hook_addr + 1) = (uintptr_t)&swimFix - hook_addr - 5; *(uint8_t*)(hook_addr + 5) = 0x90; VirtualProtect((void*)hook_addr, 6, oldProt, NULL); } void removeHook() { uintptr_t hook_addr = 0x68A50E; DWORD oldProt; VirtualProtect((void*)hook_addr, 6, PAGE_EXECUTE_READWRITE, &oldProt); uint8_t originalBytes[] = {0xD9, 0xC1, 0xD8, 0x08, 0xD9, 0xC2}; memcpy((void*)hook_addr, originalBytes, sizeof(originalBytes)); VirtualProtect((void*)hook_addr, 6, oldProt, NULL); } ]] local s = tcc.new() s:compile_string(prog) s:relocate() ffi.gc(s, nil) local AcceptSwimFix = s:get_symbol("installHook", "void(*)()") local removeSwimFix = s:get_symbol("removeHook", "void(*)()") if config.ini.settings.swimFix then AcceptSwimFix() else removeSwimFix() end end if fnc == "SwingingFix" or fnc == "all" then if config.ini.settings.swingingfix then writeMemory(0x6AC0F0, 2, 0x9090, true)--0x0575 else if fnc ~= "all" then writeMemory(0x6AC0F0, 2, 0x0575, true)--0x0575 end end end if fnc == "FixUnderBridgeForRain" or fnc == "all" then if config.ini.settings.FixUnderBridgeForRain then writeMemory(0x72DDC0+1, 4, 0x8CC2D7, true)--0xC87AB8 writeMemory(0x72DDB0+1, 4, 0x8CC2D7, true)--0xC87ABC else if fnc ~= "all" then writeMemory(0x72DDC0+1, 4, 0xC87AB8, true)--0xC87AB8 writeMemory(0x72DDB0+1, 4, 0xC87ABC, true)--0xC87ABC end end end if fnc == "UgenrlMode" or fnc == "all" then if config.ini.ugenrl_main.enable then if config.ini.ugenrl_main.mode == 0 then hex2bin("752D", 0x503D34, 2) callFunction(0x507430, 0, 0) writeMemory(0x4D89DB, 4, 0x3B1E9, true)--off sounds local bs = RakLuaBitStream.new() bs:emulIncomingRPC(42) writeMemory(0x5030D0, 1, 0xC3, true) elseif config.ini.ugenrl_main.mode == 1 then memory.fill(0x503D34, 0x90, 2, true) writeMemory(0x4D89DB, 4, 0x498D03EB, true)--on sounds callFunction(0x507430, 0, 0) elseif config.ini.ugenrl_main.mode == 2 then hex2bin("752D", 0x503D34, 2) writeMemory(0x4D89DB, 4, 0x498D03EB, true)--on sounds callFunction(0x507430, 0, 0) end end end if fnc == "Recolorer" or fnc == "all" then if preset["Recolorer"]["Recolorer"] then local function convert_color(value) local a, r, g, b = explode_argb(value) return tonumber(("0xFF%06X"):format(join_argb(0, b, g, r))) -- Формируем новое значение в формате ABGR с фиксированным альфа-каналом end memory.write(0xBAB22C, convert_color(preset["Recolorer"]["Health"]), 4, false) memory.write(0xBAB230, convert_color(preset["Recolorer"]["Money"]), 4, false) memory.write(0xBAB244, convert_color(preset["Recolorer"]["Stars"]), 4, false) memory.write(0xBAB23C, convert_color(preset["Recolorer"]["Armor"]), 4, false) memory.write(0xBAB238, convert_color(preset["Recolorer"]["Patrons"]), 4, false) memory.write(sampBase() + ((get_samp_version() == "r1") and 0x68B0C or 0x6CA7C), preset["Recolorer"]["PlayerHealth"], 4, true) memory.write(sampBase() + ((get_samp_version() == "r1") and 0x68B33 or 0x6CAA3), preset["Recolorer"]["PlayerHealth2"], 4, true) memory.write(sampBase() + ((get_samp_version() == "r1") and 0x68DD5 or 0x6CD45), preset["Recolorer"]["PlayerArmor"], 4, true) memory.write(sampBase() + ((get_samp_version() == "r1") and 0x68E00 or 0x6CD70), preset["Recolorer"]["PlayerArmor2"], 4, true) else if fnc ~= "all" then writeMemory(0xBAB22C, 4, -14870092, true) writeMemory(0xBAB230, 4, -13866954, true) writeMemory(0xBAB244, 4, -15703408, true) writeMemory(0xBAB23C, 4, -1973791, true) writeMemory(0xBAB238, 4, -930900, true) writeMemory(sampBase() + ((get_samp_version() == "r1") and 0x68B0C or 0x6CA7C), 4, -2088157, true) writeMemory(sampBase() + ((get_samp_version() == "r1") and 0x68B33 or 0x6CAA3), 4, -2109489, true) end end end if fnc == "PatchDuck" or fnc == "all" then if config.ini.settings.patchduck then writeMemory(0x692649+1, 1, 6, true)--patch anim duck else writeMemory(0x692649+1, 1, 8, true)--patch anim duck end end if fnc == "AntiCrash" or fnc == "all" then if config.ini.settings.anticrash then if get_samp_version() == "r1" then local base = sampBase() + 0x5CF2C writeMemory(base, 4, 0x90909090, true) base = base + 4 writeMemory(base, 1, 0x90, true) base = base + 9 writeMemory(base, 4, 0x90909090, true) base = base + 4 writeMemory(base, 1, 0x90, true) elseif get_samp_version() == "r3" then local base = sampBase() + 0x602CC writeMemory(base, 4, 0x90909090, true) base = base + 4 writeMemory(base, 1, 0x90, true) base = base + 9 writeMemory(base, 4, 0x90909090, true) base = base + 4 writeMemory(base, 1, 0x90, true) end end end if fnc == "FixArrowPassMotoBike" or fnc == "all" then if config.ini.settings.FixArrowPassMotoBike then memory.fill(0x6B795F, 0x90, 20, true) else if fnc ~= "all" then hex2bin("0F84FF0200008B866404000085C00F85F1020000", 0x6B795F, 20) end end end if fnc == "InterfaceElementEditor" or fnc == "all" then writeMemory(0xEDDFAF, 4, representFloatAsInt(preset["MenuPause"]["speedinputsmap"]), true) local MapOptionInputs = { [1] = 0x577679+2, [2] = 0x5779A8+2, [3] = 0x577E70+2, [4] = 0x578320+2, [5] = 0x5784B5+2, [6] = 0x578650+2 } for i = 1, #MapOptionInputs do writeMemory(MapOptionInputs[i], 4, 0xEDDFAF, true) end if preset["MenuPause"]["mapzoom"] then memory_setfloat(5719357, tonumber(preset["MenuPause"]["mapzoomvalue"]), true) else memory_setfloat(5719357, 1000.0, true) end if preset["MenuPause"]["arrowicon_menu"] then writeMemory(0x57A5B7, 4, 0x00, true) else writeMemory(0x57A5B7, 4, 0xFF, true)--disable arrow menu icon left end writeMemory(0x5799AC+1, 1, preset["MenuPause"]["fontmenubasestyle"], true) -- стиль основного шрифта меню writeMemory(0x573F6D+1, 1, preset["MenuPause"]["fontmenubasestyle"], true) -- стиль основного шрифта меню writeMemory(0x57958A+1, 1, preset["MenuPause"]["fontmenuheaderstyle"], true) -- стиль шрифта заголовка меню writeMemory(0x57A20A+1, 1, preset["MenuPause"]["fontmenutumblerstyle"], true) -- стиль шрифта тумблеров в меню if preset["MenuPause"]["gxtEntryEditor"] then local RusToGame = function(text) local convtbl = {[230]=155,[231]=159,[247]=164,[234]=107,[250]=144,[251]=168,[254]=171,[253]=170,[255]=172,[224]=97,[240]=112,[241]=99,[226]=162,[228]=154,[225]=151,[227]=153,[248]=165,[243]=121,[184]=101,[235]=158,[238]=111,[245]=120,[233]=157,[242]=166,[239]=163,[244]=63,[237]=174,[229]=101,[246]=160,[236]=175,[232]=156,[249]=161,[252]=169,[215]=141,[202]=75,[204]=77,[220]=146,[221]=147,[222]=148,[192]=65,[193]=128,[209]=67,[194]=139,[195]=130,[197]=69,[206]=79,[213]=88,[168]=69,[223]=149,[207]=140,[203]=135,[201]=133,[199]=136,[196]=131,[208]=80,[200]=133,[198]=132,[210]=143,[211]=89,[216]=142,[212]=129,[214]=137,[205]=72,[217]=138,[218]=167,[219]=145} local result = {} for i = 1, #text do local c = text:byte(i) result[i] = string.char(convtbl[c] or c) end return table.concat(result) end local beginText = preset["MenuPause"]["useMynameInBeginMenu"] and sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) or preset["MenuPause"]["beginText"] setGxtEntry("FET_PAU", RusToGame(beginText)) setGxtEntry("FEP_RES", RusToGame(preset["MenuPause"]["resume"])) setGxtEntry("FEH_SGA", RusToGame(preset["MenuPause"]["start_new_game"])) setGxtEntry("FEH_MAP", RusToGame(preset["MenuPause"]["map"])) setGxtEntry("FEP_STA", RusToGame(preset["MenuPause"]["stats"])) setGxtEntry("FEH_BRI", RusToGame(preset["MenuPause"]["brief"])) setGxtEntry("FEP_OPT", RusToGame(preset["MenuPause"]["settings"])) setGxtEntry("FEP_QUI", RusToGame(preset["MenuPause"]["quitGame"])) end local sizeiconmap = { [1] = { mem = 0x586047, nmem = 0xCB0650, val = preset["Radar"]["osnov_icon"], sval = 8.0 }, --Иконки [2] = { mem = 0x586060, nmem = 0xCB0655, val = preset["Radar"]["osnov_icon"], sval = 8.0 }, --Иконки [3] = { mem = 0x584192, nmem = 0xCB0665, val = 0.0015625 / preset["Radar"]["quadro_icon_size"], sval = 0.0015625 }, -- X Квадртаные игроки [4] = { mem = 0x5841B2, nmem = 0xCB0670, val = 0.00203125 / preset["Radar"]["quadro_icon_size"], sval = 0.00203125 }, -- Y Квадртаные игроки [5] = { mem = 0x58410D, nmem = 0xCB0675, val = 0.0016471354 / preset["Radar"]["quadro_icon_border"], sval = 0.0016471354}, -- Обводка X Квадртаные игроки [6] = { mem = 0x58412D, nmem = 0xCB0680, val = 0.00214843762 / preset["Radar"]["quadro_icon_border"], sval = 0.00214843762}, -- Обводка Y Квадртаные игроки [7] = { mem = 0x5842E8, nmem = 0xCB0685, val = 0.0015625 / preset["Radar"]["trianglen_icon_size"], sval = 0.0015625 }, -- Треугольные игроки вниз X [8] = { mem = 0x5842C8, nmem = 0xCB0690, val = 0.00203125 / preset["Radar"]["trianglen_icon_size"], sval = 0.00203125 }, -- Треугольные игроки вниз Y [9] = { mem = 0x58424B, nmem = 0xCB0695, val = 0.0016471354 / preset["Radar"]["trianglen_icon_border"], sval = 0.0016471354}, -- Обводка X Треугольные игроки вниз [10] = { mem = 0x584209, nmem = 0xCB0700, val = 0.00214843762 / preset["Radar"]["trianglen_icon_border"], sval = 0.00214843762}, -- Обводка Y Треугольные игроки вниз [11] = { mem = 0x584436, nmem = 0xCB0705, val = 0.0015625 / preset["Radar"]["trianglev_icon_size"], sval = 0.0015625 }, -- Треугольные игроки вверх X [12] = { mem = 0x58440E, nmem = 0xCB0710, val = 0.00203125 / preset["Radar"]["trianglev_icon_size"], sval = 0.00203125}, -- Треугольные игроки вверх Y [13] = { mem = 0x58439E, nmem = 0xCB0715, val = 0.0016471354 / preset["Radar"]["trianglev_icon_border"], sval = 0.0016471354}, -- Треугольные игроки вверх Обводка X [14] = { mem = 0x584348, nmem = 0xCB0720, val = 0.00214843762 / preset["Radar"]["trianglev_icon_border"], sval = 0.00214843762}, -- Треугольные игроки вверх Обводка Y [15] = { mem = 0x5886DC, nmem = 0xCB0725, val = preset["Radar"]["player_icon_size"], sval = 8.0 }, --Игрок на карте [16] = { mem = 0x584A02, nmem = 0xCB0730, val = preset["Radar"]["arrowmap_size"], sval = 25.0 }, --иконка arrow X 25 std [17] = { mem = 0x584A1A, nmem = 0xCB0735, val = preset["Radar"]["arrowmap_size"], sval = 25.0 }, --иконка arrow Y 25 std } if preset["Radar"]["smalliconsradar"] then for i = 1, #sizeiconmap do memory_setfloat(sizeiconmap[i]["nmem"], sizeiconmap[i]["val"], true)-- пишем значение в свободную память memory.write(sizeiconmap[i]["mem"], sizeiconmap[i]["nmem"], 4, true)--переврайт на свободную память end else for i = 1, #sizeiconmap do memory_setfloat(sizeiconmap[i]["nmem"], sizeiconmap[i]["sval"], true)-- пишем значение в свободную память memory.write(sizeiconmap[i]["mem"], sizeiconmap[i]["nmem"], 4, true)--переврайт на свободную память end end if preset["Radar"]["radrarnorth"] then memory.fill(0x588188, 0x90, 5, true) else hex2bin('E863DEFFFF', 0x588188, 5) end if preset["Money"]["fontmoneystyle"] ~= 3 then writeMemory(0x58F52D+1, 1, 1, true) else writeMemory(0x58F52D+1, 1, 0, true) end writeMemory(0x58F57E+1, 1, preset["Money"]["fontmoneystyle"], true) writeMemory(0x58F58D, 1, preset["Money"]["fontmoneyborder"], true) if preset["Money"]["animmoney"] == 0 then memory.write(5707667, 138, 1, true) elseif preset["Money"]["animmoney"] == 1 then memory.write(5707667, 137, 1, true) elseif preset["Money"]["animmoney"] == 2 then memory.write(5707667, 139, 1, true) end if preset["Money"]["moneyzerofix"] then if preset["Money"]["posdollar"] == 0 then -- Знак доллара слева memory.copy(0x866C94, memory.strptr('$%d'), 6, true) memory.copy(0x866C8C, memory.strptr('$-%d'), 6, true) else -- Знак доллара справа memory.copy(0x866C94, memory.strptr('%d$'), 6, true) memory.copy(0x866C8C, memory.strptr('%d-$'), 6, true) end else if preset["Money"]["posdollar"] == 0 then -- Знак доллара слева с нулями memory.copy(0x866C94, memory.strptr('$%08d'), 6, true) memory.copy(0x866C8C, memory.strptr('-$%08d'), 6, true) else -- Знак доллара справа с нулями memory.copy(0x866C94, memory.strptr('%08d$'), 6, true) memory.copy(0x866C8C, memory.strptr('%08d-$'), 6, true) end end if preset["Patrons"]["EditPatrons"] then memory_setfloat(0xCF1010, preset["Patrons"]["posPatronsX"], true) -- pos patrons x 47.0 memory.write(0x58FA10 + 2, 0xCF1010, 4, true) -- pos patrons x 47.0 memory_setfloat(0xCF1035, preset["Patrons"]["posPatronsY"], true) -- pos patrons Y 43.0 memory.write(0x58F9E4+2, 0xCF1035, 4, true) memory_setfloat(0xCF1230, preset["Patrons"]["sizePatronsX"], true) -- длинна патрон 0.30000001 memory.write(0x5894CB+2, 0xCF1230, 4, true) memory_setfloat(0xCF2125, preset["Patrons"]["sizePatronsY"], true) -- высота патрон 0.7 memory.write(0x5894B5+2, 0xCF2125, 4, true) if preset["Patrons"]["renderammo"] then writeMemory(0x589477, 2, 0x5150, true) else writeMemory(0x589477, 2, 0x5051, true) end if preset["Patrons"]["singleclip"] then writeMemory(0x5893DF, 4, 0x90909090, true) else writeMemory(0x5893DF, 4, 0x2040BF0F, true) end if preset["Patrons"]["EternalPatrons"] then writeMemory(0x5895EB, 2, 0x9090, true) memory.fill(0x589591, 0x90, 6, true) else writeMemory(0x5895EB, 2, 0x557E, true) hex2bin("0F84AB000000", 0x589591, 6) end writeMemory(0x58952A+1, 1, preset["Patrons"]["fontammostyle"], true) else if fnc ~= "all" then memory_setfloat(0xCF1010, 47.0, true) -- pos patrons x 47.0 memory.write(0x58FA10+2, 0xCF1010, 4, true) -- pos patrons x 47.0 memory_setfloat(0xCF1035, 43.0, true) -- pos patrons Y 43.0 memory.write(0x58F9E4+2, 0xCF1035, 4, true) memory_setfloat(0xCF1230, 0.30, true) -- длинна патрон 0.30000001 memory.write(0x5894CD, 0xCF1230, 4, true) memory_setfloat(0xCF2125, 0.70, true) -- высота патрон 0.7 memory.write(0x5894B5+2, 0xCF2125, 4, true) writeMemory(0x58952A+1, 1, 1, true) writeMemory(0x589477, 2, 0x5051, true) end end if preset["Health"]["EditHealth"] then if preset["Health"]["nohealthflick"] then writeMemory(0x589282, 2, 0x09EB, true) writeMemory(0x5892AD, 2, 0x09EB, true) else writeMemory(0x589282, 2, 0x0975, true) writeMemory(0x5892AD, 2, 0x097D, true) end if preset["Health"]["oneHundredAndSixtyHPbar"] then writeMemory(0xB793E0, 4, representFloatAsInt(915.0), true) else writeMemory(0xB793E0, 4, representFloatAsInt(569.0), true) end memory_setfloat(0xCF1045, -preset["Health"]["posHealthX"], true) -- pos health bar X 141.0 memory.write(0x58EE85+2, 0xCF1045, 4, true) memory_setfloat(0xCF1050, preset["Health"]["posHealthY"], true) -- pos health bar Y 77.0 memory.write(0x58EE66+2, 0xCF1050, 4, true) memory_setfloat(0xCF1055, preset["Health"]["sizeHealthX"], true) -- длинна полоски хп 109.0 memory.write(0x5892D8, 0xCF1055, 4, true) memory_setfloat(0xCF1060, preset["Health"]["sizeHealthY"], true) -- высота полоски хп 9.0 memory.write(0x589358, 0xCF1060, 4, true) memory.write(0x589352+1, preset["Health"]["healthborder"] and 1 or 0--[[ 1 on 0 off]], 1, true) -- обводка здоровья else if fnc ~= "all" then memory_setfloat(0xCF1045, 141.0, true) -- pos health bar X 141.0 memory.write(0x58EE85+2, 0xCF1045, 4, true) memory_setfloat(0xCF1050, 77.0, true) -- pos health bar Y 77.0 memory.write(0x58EE66+2, 0xCF1050, 4, true) memory_setfloat(0xCF1055, 109.0, true) -- длинна полоски хп 109.0 memory.write(0x5892D8, 0xCF1055, 4, true) memory_setfloat(0xCF1060, 9.0, true) -- высота полоски хп 9.0 memory.write(0x589358, 0xCF1060, 4, true) memory.write(0x589352+1, 1--[[ 1 on 0 off]], 1, true) -- обводка здоровья end end if preset["Money"]["EditMoney"] then memory_setfloat(0xCF1105, -preset["Money"]["posMoneyX"], true) -- позиция денег X 32.0 memory.write(0x58F5FA+2, 0xCF1105, 4, true) memory_setfloat(0xCF1110, preset["Money"]["posMoneyY"], true) -- позиция денег Y 89.0 memory.write(0x58F5DA+2, 0xCF1110, 4, true) memory_setfloat(0xCF1115, preset["Money"]["sizeMoneyX"], true) -- длинна денег 0.55000001 memory.write(0x58F562+2, 0xCF1115, 4, true) memory_setfloat(0xCF1120, preset["Money"]["sizeMoneyY"], true) -- высота денег 1.1 memory.write(0x58F54C+2, 0xCF1120, 4, true) else if fnc ~= "all" then memory_setfloat(0xCF1105, 32.0, true) -- позиция денег X 32.0 memory.write(0x58F5FA+2, 0xCF1105, 4, true) memory_setfloat(0xCF1110, 89.0, true) -- позиция денег Y 89.0 memory.write(0x58F5DA+2, 0xCF1110, 4, true) memory_setfloat(0xCF1115, 0.550, true) -- длинна денег 0.55000001 memory.write(0x58F562+2, 0xCF1115, 4, true) memory_setfloat(0xCF1120, 1.1, true) -- высота денег 1.1 memory.write(0x58F54C+2, 0xCF1120, 4, true) end end if preset["Breath"]["EditBreath"] then memory_setfloat(0xCF1125, -preset["Breath"]["posBreathX"], true) -- позиция кислорода X 94.0 memory.write(0x58F11D+2, 0xCF1125, 4, true) memory_setfloat(0xCF1130, preset["Breath"]["posBreathY"], true) -- позиция кислорода Y 62.0 memory.write(0x58F0FE+2, 0xCF1130, 4, true) memory_setfloat(0xCF1135, preset["Breath"]["sizeBreathX"], true) -- размер кислорода X 62.0 memory.write(0x589233+2, 0xCF1135, 4, true) memory_setfloat(0xCF1140, preset["Breath"]["sizeBreathY"], true) -- размер кислорода Y 9.0 memory.write(0x58921C+2, 0xCF1140, 4, true) memory.write(0x589206+1, preset["Breath"]["breathborder"] and 1 or 0--[[ 1 on 0 off]], 1, true) -- обводка кислорода writeMemory(0x58F0D9, 2, preset["Breath"]["eternalBreath"] and 0x9090 or 0x6474, true) -- вечный кислород else if fnc ~= "all" then memory_setfloat(0xCF1130, 94.0, true) -- позиция кислорода X 94.0 memory.write(0x58F11D+2, 0xCF1130, 4, true) memory_setfloat(0xCF1135, 62.0, true) -- позиция кислорода Y 62.0 memory.write(0x58F0FE+2, 0xCF1135, 4, true) memory_setfloat(0xCF1140, 9.0, true) -- размер кислорода Y 9.0 memory.write(0x58921C+2, 0xCF1140, 4, true) end end if preset["Armor"]["EditArmor"] then if preset["Armor"]["eternalArmor"] then memory.fill(0x5890DC, 0x90, 6, true) else if fnc ~= "all" then hex2bin("0F85A1000000", 0x5890DC, 6) end end memory_setfloat(0xCF1145, -preset["Armor"]["posArmorX"], true) -- позиция брони X 94.0 memory.write(0x58EF57+2, 0xCF1145, 4, true) memory_setfloat(0xCF1150, preset["Armor"]["posArmorY"], true) -- позиция брони Y 48.0 memory.write(0x58EF38+2, 0xCF1150, 4, true) memory_setfloat(0xCF1155, preset["Armor"]["sizeArmorX"], true) -- размер брони X 62.0 memory.write(0x58915B+2, 0xCF1155, 4, true) memory_setfloat(0xCF1160, preset["Armor"]["sizeArmorY"], true) -- размер брони Y 9.0 memory.write(0x589144+2, 0xCF1160, 4, true) memory.write(0x589122+1, preset["Armor"]["armorborder"] and 1 or 0--[[ 1 on 0 off]], 1, true) -- обводка брони else if fnc ~= "all" then memory_setfloat(0xCF1145, 94.0, true) -- позиция брони X 94.0 memory.write(0x58EF57+2, 0xCF1145, 4, true) memory_setfloat(0xCF1150, 48.0, true) -- позиция брони Y 48.0 memory.write(0x58EF38+2, 0xCF1150, 4, true) memory_setfloat(0xCF1155, 62.0, true) -- размер брони X 62.0 memory.write(0x58915B+2, 0xCF1155, 4, true) memory_setfloat(0xCF1160, 9.0, true) -- размер брони Y 9.0 memory.write(0x589144+2, 0xCF1160, 4, true) end end if preset["Weapon"]["EditWeapon"] then memory_setfloat(0xCF1000, preset["Weapon"]["sizeWeaponX"], true) -- weapon icon size X 47.0 memory_setfloat(0xCF1005, preset["Weapon"]["sizeWeaponY"], true) -- weapon icon size Y 58.0 memory.write(0x58D8C9 + 2, 0xCF1000, 4, true) -- weapon icon size X memory.write(0x58D894 + 2, 0xCF1005, 4, true) -- weapon icon size Y memory.write(0x58D933 + 2, 0xCF1000, 4, true) -- size icon fist x 47.0 memory.write(0x58D94B + 2, 0xCF1005, 4, true) -- size icon fist y 58.0 memory_setfloat(0xCF1025, -preset["Weapon"]["posWeaponX"], true) -- pos weapon&fist X 32.0 memory.write(0x58F925+2, 0xCF1025, 4, true) memory_setfloat(0xCF1030, preset["Weapon"]["posWeaponY"], true) -- pos weapon&fist Y 20.0 memory.write(0x58F911+2, 0xCF1030, 4, true) else if fnc ~= "all" then memory_setfloat(0xCF1025, 32.0, true) -- pos weapon&fist X 32.0 memory.write(0x58F925+2, 0xCF1025, 4, true) memory_setfloat(0xCF1030, 20.0, true) -- pos weapon&fist Y 20.0 memory.write(0x58F911+2, 0xCF1030, 4, true) memory_setfloat(0xCF1000, 47.0, true) -- weapon icon size X 47.0 memory_setfloat(0xCF1005, 58.0, true) -- weapon icon size Y 58.0 memory.write(0x58D8C9 + 2, 0xCF1000, 4, true) -- weapon icon size X memory.write(0x58D894 + 2, 0xCF1005, 4, true) -- weapon icon size Y memory.write(0x58D933 + 2, 0xCF1000, 4, true) -- size icon fist x 47.0 memory.write(0x58D94B + 2, 0xCF1005, 4, true) -- size icon fist y 58.0 end end if preset["Wanted"]["EditWanted"] then if preset["Wanted"]["eternalwanted"] then writeMemory(0x58DD1B, 2, 0x9090, true) else if fnc ~= "all" then writeMemory(0x58DD1B, 2, 0x097E, true) end end memory_setfloat(0xCAECFA, preset["Wanted"]["spaceWanted"], true) writeMemory(0x58DFEB+2, 4, 0xCAECFA, true) writeMemory(0x58DF71+2, 4, preset["Wanted"]["emptyStars"] and 0x862B41 or 0x859520, true)--не показывать пустые звезды memory_setfloat(0xCF1250, -preset["Wanted"]["posWantedX"], true) -- позиция розыска X 29.0 memory.write(0x58DD0D+2, 0xCF1250, 4, true) memory_setfloat(0xCF1255, preset["Wanted"]["posWantedY"], true) -- позиция розыска Y 114.0 memory.write(0x58DDFA+2, 0xCF1255, 4, true) memory.write(0x58DFB1+2, 0xCF1255, 4, true) memory_setfloat(0xCF1260, preset["Wanted"]["sizeWantedX"], true) -- размер розыска X 0.60 memory.write(0x58DD84+2, 0xCF1260, 4, true) memory.write(0x58DF77+2, 0xCF1260, 4, true) memory_setfloat(0xCF1265, preset["Wanted"]["sizeWantedY"], true) -- размер розыска Y 1.21 memory.write(0x58DD6E+2, 0xCF1265, 4, true) memory.write(0x58DF5B+2, 0xCF1265, 4, true) else if fnc ~= "all" then memory_setfloat(0xCF1250, 29.0, true) -- позиция розыска X 29.0 memory.write(0x58DD0D+2, 0xCF1250, 4, true) memory_setfloat(0xCF1255, 114.0, true) -- позиция розыска Y 114.0 memory.write(0x58DDFA+2, 0xCF1255, 4, true) memory_setfloat(0xCF1275, 12.0, true) -- позиция пустого розыска Y 12.0 memory.write(0x58DF29+2, 0xCF1275, 4, true) memory_setfloat(0xCF1260, 0.60, true) -- размер розыска X 0.60 memory.write(0x58DD84+2, 0xCF1260, 4, true) memory_setfloat(0xCF1265, 1.21, true) -- размер розыска Y 1.21 memory.write(0x58DD6E+2, 0xCF1265, 4, true) end end if preset["Clock"]["EditClock"] then if preset["Clock"]["DrawClock"] then hex2bin("253032643A2530326400", 0x859A6C, 10) hex2bin("E8DABA1800", 0x58EC21, 5) else if fnc ~= "all" then hex2bin("00000000000000000000", 0x859A6C, 10) memory.fill(0x58EC21, 0x90, 5, true) end end if preset["Clock"]["PcClock"] then writeMemory(0x58EBA9 + 1, 4, 0xCDA772, true) else if fnc ~= "all" then writeMemory(0x58EBA9 + 1, 4, 0x00859A6C, true) end end memory_setfloat(0xCF1280, -preset["Clock"]["posClockX"], true) -- позиция X 32.0 memory.write(0x58EC14+2, 0xCF1280, 4, true) memory_setfloat(0xCF1285, preset["Clock"]["posClockY"], true) -- позиция Y 22.0 memory.write(0x58EC02+2, 0xCF1285, 4, true) memory_setfloat(0xCF1290, preset["Clock"]["sizeClockY"], true) -- размер Y 0.55 memory.write(0x58EB2F+2, 0xCF1290, 4, true) memory_setfloat(0xCF1295, preset["Clock"]["sizeClockX"], true) -- размер X 1.1 memory.write(0x58EB45+2, 0xCF1295, 4, true) writeMemory(0x58EB5A+1, 1, preset["Clock"]["fontstyleclock"], true)-- font style clock writeMemory(0x58EB6F+1, 1, preset["Clock"]["fontoutlineclock"], true) writeMemory(0x0058EB53+1, 1, 1, true) else if fnc ~= "all" then memory_setfloat(0xCF1280, 32.0, true) -- позиция X 32.0 memory.write(0x58EC14+2, 0xCF1280, 4, true) memory_setfloat(0xCF1285, 22.0, true) -- позиция Y 22.0 memory.write(0x58EC02+2, 0xCF1285, 4, true) memory_setfloat(0xCF1290, 1.1, true) -- размер Y 0.55 memory.write(0x58EB2F+2, 0xCF1290, 4, true) memory_setfloat(0xCF1295, 0.55, true) -- размер X 1.1 memory.write(0x58EB45+2, 0xCF1295, 4, true) end end writeMemory(0x58694E+1, 1, 1, true)-- RwEngineInstance->dOpenDevice.fpRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, 1) writeMemory(0x586432+1, 1, preset["Radar"]["radaralpha"], true) writeMemory(0x58647B+1, 1, preset["Radar"]["radaralpha"], true) writeMemory(0x5864BC+1, 1, preset["Radar"]["radaralpha"], true) writeMemory(0x586F34+1, 1, preset["Radar"]["radarblipA"], true) if preset["Radar"]["radar_color_fix"] then memory.write(0x58A798, 255, 1, true) memory.write(0x58A790, 255, 1, true) memory.write(0x58A78E, 255, 1, true) memory.write(0x58A89A, 255, 1, true) memory.write(0x58A896, 255, 1, true) memory.write(0x58A894, 255, 1, true) memory.write(0x58A8EE, 255, 1, true) memory.write(0x58A8E6, 255, 1, true) memory.write(0x58A8DE, 255, 1, true) memory.write(0x58A9A2, 255, 1, true) memory.write(0x58A99A, 255, 1, true) memory.write(0x58A996, 255, 1, true) else if fnc ~= "all" then memory.write(0x58A798, 0, 1, true) memory.write(0x58A790, 0, 1, true) memory.write(0x58A78E, 0, 1, true) memory.write(0x58A89A, 0, 1, true) memory.write(0x58A896, 0, 1, true) memory.write(0x58A894, 0, 1, true) memory.write(0x58A8EE, 0, 1, true) memory.write(0x58A8E6, 0, 1, true) memory.write(0x58A8DE, 0, 1, true) memory.write(0x58A9A2, 0, 1, true) memory.write(0x58A99A, 0, 1, true) memory.write(0x58A996, 0, 1, true) end end if preset["Radar"]["radardisc"] then writeMemory(0x58A788+1, 1, 0, true) writeMemory(0x58A8D8+1, 1, 0, true) writeMemory(0x58A88E+1, 1, 0, true) writeMemory(0X58A98E+1, 1, 0, true) else if fnc ~= "all" then writeMemory(0x58A788+1, 1, 0xFF, true) writeMemory(0x58A8D8+1, 1, 0xFF, true) writeMemory(0x58A88E+1, 1, 0xFF, true) writeMemory(0X58A98E+1, 1, 0xFF, true) end end if preset["Radar"]["minimapzoom"] then writeMemory(0x586C0A, 4, 0x90909090, true) writeMemory(0x586C0A+4, 1, 0x90, true) writeMemory(0x586C9B, 4, representFloatAsInt(preset["Radar"]["minimapzoomvalue"]), true) -- 180 | 500 else if fnc ~= "all" then writeMemory(0x586C9B, 4, representFloatAsInt(180), true) -- 180 | 500 writeMemory(0x586C0A, 4, 0xFE7481E8, true) writeMemory(0x586C0A+4, 1, 0xFF, true) end end if preset["Radar"]["radarfix"] then --fix rounded blips in radar local screenX = readMemory(0xC17044, 2, true) local screenY = readMemory(0xC17048, 2, true) local resolution = getScreenResolution() * 0.0015625; local sizeBlips = 1.0 local constMemX = 0xFFACFF + 15 local constMemY = 0xFFACFF + 20 local idealX = (sizeBlips / screenX) * resolution * 1.0 local idealY = (sizeBlips / screenY) * resolution * 1.0 writeMemory(constMemX, 4, representFloatAsInt(idealX), false) writeMemory(constMemY, 4, representFloatAsInt(idealY), false) --[[writeMemory(0x5876D4+2, 4, constMemX, true)--Blips X writeMemory(0x58774B+2, 4, constMemX, true)--Blips X writeMemory(0x58780A+2, 4, constMemX, true)--Blips X writeMemory(0x58788F+2, 4, constMemX, true)--Blips X writeMemory(0x58792E+2, 4, constMemX, true)--Blips X writeMemory(0x587A1A+2, 4, constMemX, true)--Blips X writeMemory(0x587AAA+2, 4, constMemX, true)--Blips X]] writeMemory(0x58808D+2, 4, constMemX, true)--Blips X writeMemory(0x5886CC+2, 4, constMemX, true)--Blips X --[[writeMemory(0x5876BC+2, 4, constMemY, true)--Blips Y writeMemory(0x587733+2, 4, constMemY, true)--Blips Y writeMemory(0x587916+2, 4, constMemY, true)--Blips Y writeMemory(0x587A02+2, 4, constMemY, true)--Blips Y writeMemory(0x587A92+2, 4, constMemY, true)--Blips Y writeMemory(0x588060+2, 4, constMemY, true)--Blips Y writeMemory(0x588294+2, 4, constMemY, true)--Blips Y]] writeMemory(0x58603F+2, 4, constMemX, true)--Blips X writeMemory(0x586058+2, 4, constMemY, true)--Blips Y --========================================= memory_setfloat(0xCAE000, preset["Radar"]["radarPosX"], true) local radarPosX = { [1] = 0x58A79B, [2] = 0x5834D4, [3] =0x58A836, [4] = 0x58A8E9, [5] = 0x58A98A, [6] = 0x58A469, [7] = 0x58A5E2, [8] = 0x58A6E6, [9] = 0x58A467+2, } for i = 0, #radarPosX do writeMemory(radarPosX[i], 4, 0xCAE000, true) end memory_setfloat(0xCAE005, preset["Radar"]["radarPosY"], true) local radarPosY = { [1] = 0x58A7C7, [2] = 0x58A868, [3] = 0x58A913, [4] = 0x58A9C7, [5] = 0x583500, [6] = 0x58A499, [7] = 0x58A60E, [8] = 0x58A71E, [9] = 0x58A497+2, } for i = 0, #radarPosY do writeMemory(radarPosY[i], 4, 0xCAE005, true) end if preset["Radar"]["Type"] ~= 1 then memory_setfloat(0xCAE010, preset["Radar"]["radarWidth"], true) local radarWidth = { [1] = 0x58A47D, [2] = 0x58A632, [3] = 0x58A6AB, [4] = 0x58A70E, [5] = 0x58A801, [6] = 0x58A8AB, [7] = 0x58A921, [8] = 0x58A9D5, [9] = 0x5834F6, [10] = 0x58A47B+2, } for i = 0, #radarWidth do writeMemory(radarWidth[i], 4, 0xCAE010, true) end memory_setfloat(0xCAE015, preset["Radar"]["radarHeight"], true) local radarHeight = { [1] = 0x5834C2, [2] = 0x58A449, [3] = 0x58A7E9, [4] = 0x58A840, [5] = 0x58A943, [6] = 0x58A99D, [7] = 0x58A447+2 } for i = 0, #radarHeight do writeMemory(radarHeight[i], 4, 0xCAE015, true) end local constMemX = 0xFFACEF writeMemory(constMemX, 4, representFloatAsInt(0.0015625), false) writeMemory(0x5834BC, 4, constMemX, false) writeMemory(0x58A443, 4, constMemX, false) writeMemory(0x58A5DA, 4, constMemX, false) writeMemory(0x58A6E0, 4, constMemX, false) writeMemory(0x58A793, 4, constMemX, false) writeMemory(0x58A830, 4, constMemX, false) writeMemory(0x58A8E1, 4, constMemX, false) writeMemory(0x58A984, 4, constMemX, false) writeMemory(0x58A984, 4, constMemX, false) local constMemY = 0xFFACEF + 5 writeMemory(constMemY, 4, representFloatAsInt(0.002232143), false) writeMemory(0x5834EC+2, 4, constMemY, false) writeMemory(0x58A473+2, 4, constMemY, false) writeMemory(0x58A600+2, 4, constMemY, false) writeMemory(0x58A69E+2, 4, constMemY, false) writeMemory(0x58A704+2, 4, constMemY, false) writeMemory(0x58A7B9+2, 4, constMemY, false) writeMemory(0x58A85A+2, 4, constMemY, false) writeMemory(0x58A909+2, 4, constMemY, false) writeMemory(0x58A9BD+2, 4, constMemY, false) writeMemory(0x58A9BD+2, 4, constMemY, false) --===================================================================================== end if preset["Radar"]["Type"] == 2 then writeMemory(0x58585A, 4, 0x40180DD8, true) else writeMemory(0x58585A, 4, 0x8F1C0DD8, true) end if preset["Radar"]["Type"] == 1 then local screenX, screenY = getScreenResolution() local resolution = getScreenResolution() * 0.0015625; --================================ [ Radar ] ============================================ local idealX = (preset["Radar"]["roundedRadarSize"] / screenX) * resolution * 0.8 local constMemX = 0xFFACEF writeMemory(constMemX, 4, representFloatAsInt(idealX), false) writeMemory(0x5834BC, 4, constMemX, false) writeMemory(0x58A443, 4, constMemX, false) writeMemory(0x58A5DA, 4, constMemX, false) writeMemory(0x58A6E0, 4, constMemX, false) writeMemory(0x58A793, 4, constMemX, false) writeMemory(0x58A830, 4, constMemX, false) writeMemory(0x58A8E1, 4, constMemX, false) writeMemory(0x58A984, 4, constMemX, false) writeMemory(0x58A984, 4, constMemX, false) local constMemY = 0xFFACEF + 5 local idealY = (preset["Radar"]["roundedRadarSize"] / screenY) * resolution * 1 writeMemory(constMemY, 4, representFloatAsInt(idealY), false) writeMemory(0x5834EC+2, 4, constMemY, false) writeMemory(0x58A473+2, 4, constMemY, false) writeMemory(0x58A600+2, 4, constMemY, false) writeMemory(0x58A69E+2, 4, constMemY, false) writeMemory(0x58A704+2, 4, constMemY, false) writeMemory(0x58A7B9+2, 4, constMemY, false) writeMemory(0x58A85A+2, 4, constMemY, false) writeMemory(0x58A909+2, 4, constMemY, false) writeMemory(0x58A9BD+2, 4, constMemY, false) writeMemory(0x58A9BD+2, 4, constMemY, false) --===================================================================================== memory_setfloat(0xCAE010, 76.0, true) local radarWidth = { [1] = 0x58A47D, [2] = 0x58A632, [3] = 0x58A6AB, [4] = 0x58A70E, [5] = 0x58A801, [6] = 0x58A8AB, [7] = 0x58A921, [8] = 0x58A9D5, [9] = 0x5834F6, [10] = 0x58A47B+2, } for i = 0, #radarWidth do writeMemory(radarWidth[i], 4, 0xCAE010, true) end memory_setfloat(0xCAE015, 94.0, true) local radarHeight = { [1] = 0x5834C2, [2] = 0x58A449, [3] = 0x58A7E9, [4] = 0x58A840, [5] = 0x58A943, [6] = 0x58A99D, [7] = 0x58A447+2 } for i = 0, #radarHeight do writeMemory(radarHeight[i], 4, 0xCAE015, true) end end else if fnc ~= "all" then memory_setfloat(0xCAE000, 40.0, true) local radarPosX = { [1] = 0x58A79B, [2] = 0x5834D4, [3] = 0x58A836, [4] = 0x58A8E9, [5] = 0x58A98A, [6] = 0x58A469, [7] = 0x58A5E2, [8] = 0x58A6E6, [9] = 0x58A467+2, } for i = 0, #radarPosX do writeMemory(radarPosX[i], 4, 0xCAE000, true) end memory_setfloat(0xCAE005, 104.0, true) local radarPosY = { [1] = 0x58A7C7, [2] = 0x58A868, [3] = 0x58A913, [4] = 0x58A9C7, [5] = 0x583500, [6] = 0x58A499, [7] = 0x58A60E, [8] = 0x58A71E, [9] = 0x58A497+2, } for i = 0, #radarPosY do writeMemory(radarPosY[i], 4, 0xCAE005, true) end memory_setfloat(0xCAE010, 76.0, true) local radarWidth = { [1] = 0x58A47D, [2] = 0x58A632, [3] = 0x58A6AB, [4] = 0x58A70E, [5] = 0x58A801, [6] = 0x58A8AB, [7] = 0x58A921, [8] = 0x58A9D5, [9] = 0x5834F6, [10] = 0x58A47B+2, } for i = 0, #radarWidth do writeMemory(radarWidth[i], 4, 0xCAE010, true) end memory_setfloat(0xCAE015, 94.0, true) local radarHeight = { [1] = 0x5834C2, [2] = 0x58A449, [3] = 0x58A7E9, [4] = 0x58A840, [5] = 0x58A943, [6] = 0x58A99D, [7] = 0x58A447+2 } for i = 0, #radarHeight do writeMemory(radarHeight[i], 4, 0xCAE015, true) end end end checkboxes.radarfix[0] = preset["Radar"]["radarfix"] end end ------------------------------------ function imgui.NewInputText(lable, val, width, hint, hintpos) local hint = hint and hint or '' local hintpos = tonumber(hintpos) and tonumber(hintpos) or 1 local cPos = imgui.GetCursorPos() imgui.PushItemWidth(width) local result = imgui.InputText(lable, val, sizeof(val)) if #str(val) == 0 then local hintSize = imgui.CalcTextSize(hint) if hintpos == 2 then imgui.SameLine(cPos.x + (width - hintSize.x) / 2) elseif hintpos == 3 then imgui.SameLine(cPos.x + (width - hintSize.x - 5)) else imgui.SameLine(cPos.x + 5) end imgui.TextColored(imgui.ImVec4(1.00, 1.00, 1.00, 0.40), tostring(hint)) end imgui.PopItemWidth() return result end function imgui.Link(link, text) text = text or link local tSize = imgui.CalcTextSize(text) local p = imgui.GetCursorScreenPos() local DL = imgui.GetWindowDrawList() local col = { imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.ButtonHovered]) } if imgui.InvisibleButton("##" .. link, tSize) then os.execute("explorer " .. link) end local color = imgui.IsItemHovered() and col[1] or col[2] DL:AddText(p, color, text) --DL:AddLine(imgui.ImVec2(p.x, p.y + tSize.y), imgui.ImVec2(p.x + tSize.x, p.y + tSize.y), color) end -- labels - Array - названия элементов меню -- selected - imgui.ImInt() - выбранный пункт меню -- size - imgui.ImVec2() - размер элементов -- speed - float - скорость анимации выбора элемента (необязательно, по стандарту - 0.2) -- centering - bool - центрирование текста в элементе (необязательно, по стандарту - false) function imgui.CustomMenu(labels, selected, size, speed, centering) local bool = false speed = speed and speed or 0.500 local radius = size.y * 0.50 local draw_list = imgui.GetWindowDrawList() if LastActiveTime == nil then LastActiveTime = {} end if LastActive == nil then LastActive = {} end local function ImSaturate(f) return f < 0.0 and 0.0 or (f > 1.0 and 1.0 or f) end for i, v in ipairs(labels) do local c = imgui.GetCursorPos() local p = imgui.GetCursorScreenPos() if imgui.InvisibleButton(v..'##'..i, size) then selected[0] = i LastActiveTime[v] = os.clock() LastActive[v] = true bool = true end imgui.SetCursorPos(c) local t = selected[0] == i and 1.0 or 0.0 if LastActive[v] then local time = os.clock() - LastActiveTime[v] if time <= 0.3 then local t_anim = ImSaturate(time / speed) t = selected[0] == i and t_anim or 1.0 - t_anim else LastActive[v] = false end end local col_bg = imgui.GetColorU32Vec4(selected[0] == i and imgui.ImVec4(0.10, 0.10, 0.10, 0.60) or imgui.ImVec4(0,0,0,0)) local col_box = imgui.GetColorU32Vec4(selected[0] == i and imgui.ImVec4(config.ini.logocolor.r, config.ini.logocolor.g, config.ini.logocolor.b, config.ini.logocolor.a) or imgui.ImVec4(0,0,0,0)) local col_hovered = imgui.GetStyle().Colors[imgui.Col.ButtonHovered] local col_hovered = imgui.GetColorU32Vec4(imgui.ImVec4(col_hovered.x, col_hovered.y, col_hovered.z, (imgui.IsItemHovered() and 0.2 or 0))) if selected[0] == i then draw_list:AddRectFilledMultiColor(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + (radius * 0.65) + t * size.x, p.y + size.y), imgui.GetColorU32Vec4(imgui.ImVec4(icolors.PLeftUp[0], icolors.PLeftUp[1], icolors.PLeftUp[2], icolors.PLeftUp[3])), imgui.GetColorU32Vec4(imgui.ImVec4(icolors.PRightUp[0], icolors.PRightUp[1], icolors.PRightUp[2], icolors.PRightUp[3])), imgui.GetColorU32Vec4(imgui.ImVec4(icolors.PRightDown[0], icolors.PRightDown[1], icolors.PRightDown[2], icolors.PRightDown[3])), imgui.GetColorU32Vec4(imgui.ImVec4(icolors.PLeftDown[0], icolors.PLeftDown[1], icolors.PLeftDown[2], icolors.PLeftDown[3]))) end draw_list:AddRectFilled(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + (radius * 0.65) + size.x, p.y + size.y), col_hovered, 0.0) imgui.SetCursorPos(imgui.ImVec2(c.x+(centering and (size.x-imgui.CalcTextSize(v).x)/2 or 15), c.y+(size.y-imgui.CalcTextSize(v).y)/2)) if selected[0] == i then imgui.TextColored(imgui.ImVec4(icolors.ActiveText[0], icolors.ActiveText[1], icolors.ActiveText[2], icolors.ActiveText[3]), v) else imgui.TextColored(imgui.ImVec4(icolors.PassiveText[0], icolors.PassiveText[1], icolors.PassiveText[2], icolors.PassiveText[3]), v) end draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x+3.5, p.y + size.y), col_box) imgui.SetCursorPos(imgui.ImVec2(c.x, c.y+size.y)) end return bool end function imgui.CustomSelectable(labels, selected, size, speed, centering) local bool = false speed = speed and speed or 0.500 local radius = size.y * 0.50 local draw_list = imgui.GetWindowDrawList() if LastActiveTime == nil then LastActiveTime = {} end if LastActive == nil then LastActive = {} end local function ImSaturate(f) return f < 0.0 and 0.0 or (f > 1.0 and 1.0 or f) end for i, v in ipairs(labels) do local c = imgui.GetCursorPos() local p = imgui.GetCursorScreenPos() if imgui.InvisibleButton(v..'##'..i, size) then selected[0] = i LastActiveTime[v] = os.clock() LastActive[v] = true bool = true end imgui.SetCursorPos(c) local t = selected[0] == i and 1.0 or 0.0 if LastActive[v] then local time = os.clock() - LastActiveTime[v] if time <= 0.3 then local t_anim = ImSaturate(time / speed) t = selected[0] == i and t_anim or 1.0 - t_anim else LastActive[v] = false end end local col_bg = imgui.GetColorU32Vec4(selected[0] == i and imgui.ImVec4(0.10, 0.10, 0.10, 0.60) or imgui.ImVec4(0,0,0,0)) local col_box = imgui.GetColorU32Vec4(selected[0] == i and imgui.ImVec4(icolors.ActiveText[0], icolors.ActiveText[1], icolors.ActiveText[2], icolors.ActiveText[3]) or imgui.ImVec4(0,0,0,0)) local col_hovered = imgui.GetStyle().Colors[imgui.Col.ButtonHovered] local col_hovered = imgui.GetColorU32Vec4(imgui.ImVec4(col_hovered.x, col_hovered.y, col_hovered.z, (imgui.IsItemHovered() and 0.2 or 0))) if selected[0] == i then draw_list:AddRectFilledMultiColor(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + (radius * 0.65) + t * size.x, p.y + size.y), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button])) end --if selected[0] == i then draw_list:AddRectFilled(imgui.ImVec2(p.x-size.x, p.y), imgui.ImVec2(p.x + size.x, p.y + size.y), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), 0.0) end draw_list:AddRectFilled(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + size.x+10, p.y + size.y), col_hovered, 0.0) imgui.SetCursorPos(imgui.ImVec2(c.x+(centering and (size.x-imgui.CalcTextSize(v).x)/2 or 15), c.y+(size.y-imgui.CalcTextSize(v).y)/2)) imgui.TextColored(imgui.ImVec4(imgui.GetStyle().Colors[imgui.Col.Text]), v) --draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x+3.5, p.y + size.y), col_box) imgui.SetCursorPos(imgui.ImVec2(c.x, c.y+size.y)) end return bool end function imgui.MainBox(str_id, size, rounding) local ImVec2 = imgui.ImVec2 local DL = imgui.GetWindowDrawList() local posS = imgui.GetCursorScreenPos() local title = str_id:gsub('##.+$', '') local sizeT = imgui.CalcTextSize(title) local bgColor = imgui.GetStyle().Colors[imgui.Col.Button] local bgColorHover = imgui.GetColorU32Vec4(imgui.ImVec4(bgColor.x, bgColor.y, bgColor.z, 0.7)) local bgColorNormal = imgui.GetColorU32Vec4(imgui.ImVec4(bgColor.x, bgColor.y, bgColor.z, 0.7)) imgui.PushStyleColor(imgui.Col.ChildBg, imgui.ImVec4(0, 0, 0, 0)) imgui.PushStyleVarFloat(imgui.StyleVar.ChildRounding, rounding) imgui.PushStyleColor(imgui.Col.Border, imgui.ImVec4(0, 0, 0, 0)) local posE = ImVec2(posS.x + size.x, posS.y + size.y) local mousePos = imgui.GetMousePos() DL:AddRectFilledMultiColor(posS, ImVec2(posS.x + size.x, posS.y + size.y), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.mainBoxColorUP.r, config.ini.mainBoxColorUP.g, config.ini.mainBoxColorUP.b, config.ini.mainBoxColorUP.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.mainBoxColorUP.r, config.ini.mainBoxColorUP.g, config.ini.mainBoxColorUP.b, config.ini.mainBoxColorUP.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.mainBoxColor.r, config.ini.mainBoxColor.g, config.ini.mainBoxColor.b, config.ini.mainBoxColor.a)), imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.mainBoxColor.r, config.ini.mainBoxColor.g, config.ini.mainBoxColor.b, config.ini.mainBoxColor.a))) imgui.BeginChild(str_id, size, true) imgui.PopStyleColor(2) imgui.PopStyleVar() end function imgui.BetterInput(name, hint_text, buffer, color, text_color, width) -- Локальные функции для анимации local function bringVec4To(from, to, start_time, duration) local timer = os.clock() - start_time if timer >= 0.00 and timer <= duration then local count = timer / (duration / 100) return imgui.ImVec4( from.x + (count * (to.x - from.x) / 100), from.y + (count * (to.y - from.y) / 100), from.z + (count * (to.z - from.z) / 100), from.w + (count * (to.w - from.w) / 100) ), true end return (timer > duration) and to or from, false end local function bringFloatTo(from, to, start_time, duration) local timer = os.clock() - start_time if timer >= 0.00 and timer <= duration then local count = timer / (duration / 100) return from + (count * (to - from) / 100), true end return (timer > duration) and to or from, false end -- Инициализация UI_BETTERINPUT UI_BETTERINPUT = UI_BETTERINPUT or {} UI_BETTERINPUT[name] = UI_BETTERINPUT[name] or { buffer = buffer or imgui.ImBuffer(256), width = width or math.max(150, imgui.CalcTextSize(hint_text).x + 50), hint = { pos = imgui.ImVec2(imgui.GetCursorPos()), old_pos = imgui.GetCursorPos().y, scale = 1.0 }, color = imgui.GetStyle().Colors[imgui.Col.TextDisabled], old_color = imgui.GetStyle().Colors[imgui.Col.TextDisabled], active = { false, nil }, inactive = { true, nil } } local pool = UI_BETTERINPUT[name] color = color or imgui.GetStyle().Colors[imgui.Col.ButtonActive] -- Настройка стилей imgui.PushStyleColor(imgui.Col.FrameBg, imgui.ImVec4(1, 1, 1, 0)) imgui.PushStyleColor(imgui.Col.Text, text_color or imgui.ImVec4(1, 1, 1, 1)) imgui.PushStyleColor(imgui.Col.TextSelectedBg, color) imgui.PushStyleVarVec2(imgui.StyleVar.FramePadding, imgui.ImVec2(0, imgui.GetStyle().FramePadding.y)) imgui.PushItemWidth(pool.width) -- Декоративная линия local draw_list = imgui.GetWindowDrawList() local line_y = imgui.GetCursorPos().y + imgui.GetWindowPos().y + (2 * imgui.GetStyle().FramePadding.y) + imgui.CalcTextSize(hint_text).y draw_list:AddLine( imgui.ImVec2(imgui.GetCursorPos().x + imgui.GetWindowPos().x, line_y), imgui.ImVec2(imgui.GetCursorPos().x + imgui.GetWindowPos().x + pool.width, line_y), imgui.GetColorU32Vec4(pool.color), 2.0 ) -- Поле ввода local resins = imgui.InputText("##" .. name, pool.buffer, sizeof(pool.buffer)) -- Переключение состояний if not imgui.IsItemActive() then pool.inactive[2] = pool.inactive[2] or os.clock() pool.inactive[1], pool.active[1], pool.active[2] = true, false, nil elseif imgui.IsItemActive() or imgui.IsItemClicked() then pool.inactive[1], pool.inactive[2], pool.active[2] = false, nil, pool.active[2] or os.clock() pool.active[1] = true end -- Анимация подсказки local target_scale = (pool.active[1] or sizeof(pool.buffer) > 0) and 1.0 or 3.0 local target_y = (pool.active[1] or sizeof(pool.buffer) > 0) and (pool.hint.old_pos - (imgui.GetFontSize() * 0.7) - 2) or pool.hint.old_pos pool.color = bringVec4To(pool.color, (pool.active[1] and color or pool.old_color), (pool.active[1] and pool.active[2] or pool.inactive[2]), 0.75) pool.hint.scale = bringFloatTo(pool.hint.scale, target_scale, (pool.active[1] and pool.active[2] or pool.inactive[2]), 0.55) pool.hint.pos.y = bringFloatTo(pool.hint.pos.y, target_y, (pool.active[1] and pool.active[2] or pool.inactive[2]), 0.25) -- Отображение подсказки imgui.SetWindowFontScale(pool.hint.scale) draw_list:AddText( imgui.ImVec2(pool.hint.pos.x + imgui.GetWindowPos().x + imgui.GetStyle().FramePadding.x, pool.hint.pos.y + imgui.GetWindowPos().y + imgui.GetStyle().FramePadding.y), imgui.GetColorU32Vec4(pool.color), hint_text ) -- Восстановление стилей imgui.SetWindowFontScale(1.0) imgui.PopItemWidth() imgui.PopStyleColor(3) imgui.PopStyleVar() return resins end local active_slider_id, alt_active_slider_id = nil, nil function imgui.CustomSlider(str_id, value, min, max, sformat, width) local width = width or 100 local DL = imgui.GetWindowDrawList() local p = imgui.GetCursorScreenPos() -- Инициализация состояния слайдера UI_CUSTOM_SLIDER = UI_CUSTOM_SLIDER or {} UI_CUSTOM_SLIDER[str_id] = UI_CUSTOM_SLIDER[str_id] or { active = false, hovered = false, start = 0, smooth_value = value[0] -- Всегда храним плавное значение для анимации } -- Создаем невидимую кнопку для взаимодействия imgui.InvisibleButton(str_id, imgui.ImVec2(width, 20)) local isActive, isHovered = imgui.IsItemActive(), imgui.IsItemHovered() UI_CUSTOM_SLIDER[str_id].active = isActive UI_CUSTOM_SLIDER[str_id].hovered = isHovered -- Управление активными слайдерами if isActive then if imgui.GetIO().KeyAlt then alt_active_slider_id = str_id else active_slider_id = str_id end else if active_slider_id == str_id then active_slider_id = nil end if alt_active_slider_id == str_id and not imgui.GetIO().KeyAlt then alt_active_slider_id = nil end end -- Определяем тип значения (целое или дробное) local isInteger = (math.floor(min) == min) and (math.floor(max) == max) local step = (max - min) / (width * (isInteger and 10 or 80)) -- Обработка ввода local isAltPressed = imgui.GetIO().KeyAlt local mouseDown = imgui.IsMouseDown(0) if ((str_id == active_slider_id and not isAltPressed) or (str_id == alt_active_slider_id and isAltPressed)) and mouseDown then local mousePos = imgui.GetMousePos() local delta = imgui.GetIO().MouseDelta.x if isAltPressed then -- Плавное изменение при зажатом Alt UI_CUSTOM_SLIDER[str_id].smooth_value = UI_CUSTOM_SLIDER[str_id].smooth_value + delta * step UI_CUSTOM_SLIDER[str_id].smooth_value = math.max(min, math.min(max, UI_CUSTOM_SLIDER[str_id].smooth_value)) value[0] = isInteger and math.floor(UI_CUSTOM_SLIDER[str_id].smooth_value + 0.5) or UI_CUSTOM_SLIDER[str_id].smooth_value else -- Прямое перетаскивание if mousePos.x - p.x >= 0 and mousePos.x - p.x <= width then UI_CUSTOM_SLIDER[str_id].smooth_value = min + (max - min) * (mousePos.x - p.x) / width UI_CUSTOM_SLIDER[str_id].smooth_value = math.max(min, math.min(max, UI_CUSTOM_SLIDER[str_id].smooth_value)) value[0] = isInteger and math.floor(UI_CUSTOM_SLIDER[str_id].smooth_value + 0.5) or UI_CUSTOM_SLIDER[str_id].smooth_value end end else -- Плавное возвращение к актуальному значению, когда слайдер не активен if math.abs(UI_CUSTOM_SLIDER[str_id].smooth_value - value[0]) > 0.001 then UI_CUSTOM_SLIDER[str_id].smooth_value = UI_CUSTOM_SLIDER[str_id].smooth_value + (value[0] - UI_CUSTOM_SLIDER[str_id].smooth_value) * 0.3 else UI_CUSTOM_SLIDER[str_id].smooth_value = value[0] end end -- Визуализация слайдера (всегда используем smooth_value для позиции круга) local posCircleX = p.x + 7.5 + (width - 10) * (UI_CUSTOM_SLIDER[str_id].smooth_value - min) / (max - min) -- Цвета local eCol = imgui.GetStyle().Colors[imgui.Col.FrameBg] local brightness = isHovered and 0.05 or 0 local triangleColor = imgui.ImVec4( eCol.x + brightness, eCol.y + brightness, eCol.z + brightness, 1.0 ) -- Рисуем полосу слайдера if (str_id == active_slider_id and isAltPressed) or (str_id == alt_active_slider_id and isAltPressed) then -- Стиль для точной настройки (Alt) DL:AddRectFilled( imgui.ImVec2(p.x, p.y + 7), imgui.ImVec2(p.x + width, p.y + 14), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]) ) -- Стрелки для индикации точной настройки local arrowSize, halfArrowSize, midY = 10, 5, p.y + 10 DL:AddTriangleFilled( imgui.ImVec2(p.x, midY - halfArrowSize), imgui.ImVec2(p.x + arrowSize, midY), imgui.ImVec2(p.x, midY + halfArrowSize), imgui.GetColorU32Vec4(triangleColor) ) DL:AddTriangleFilled( imgui.ImVec2(p.x + width, midY - halfArrowSize), imgui.ImVec2(p.x + width - arrowSize, midY), imgui.ImVec2(p.x + width, midY + halfArrowSize), imgui.GetColorU32Vec4(triangleColor) ) else -- Обычный стиль слайдера DL:AddRectFilledMultiColor( imgui.ImVec2(p.x, p.y + 7), imgui.ImVec2(p.x + width, p.y + 14), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBg]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBg]), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Button]) ) -- Ползунок (увеличиваем визуальный размер) local circleRadius = 12 -- Увеличиваем радиус для лучшей видимости DL:AddCircleFilled( imgui.ImVec2(posCircleX, p.y + 10), circleRadius, imgui.GetColorU32Vec4(triangleColor), 32 ) DL:AddCircle( imgui.ImVec2(posCircleX, p.y + 10), circleRadius, imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.WindowBg]), 32, 1.5 -- Увеличиваем толщину обводки ) end -- Отображение значения DL:AddText( imgui.ImVec2(p.x + width + 10, p.y), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.Text]), string.format(sformat, value[0]) ) return isActive end CloseButton = function(text, value, pos) imgui.SetCursorPos(pos) local result = imgui.InvisibleButton("##texthyeta", imgui.ImVec2(20, 20)) if result then value[0] = false end local hovered = imgui.IsItemHovered() local col = hovered and imgui.GetStyle().Colors[imgui.Col.Button] or imgui.GetStyle().Colors[imgui.Col.Text] imgui.SetCursorPos(pos) imgui.PushFont(fonts[28]) imgui.PushFont(iconFont) imgui.PushStyleColor(imgui.Col.Text, col) imgui.Text(fa.ICON_FA_SIGN_OUT_ALT) imgui.PopStyleColor() imgui.PopFont() imgui.PopFont() return result end function imgui.Hint(text, delay, action) if imgui.IsItemHovered() then if go_hint == nil then go_hint = os.clock() + (delay and delay or 0.0) end local alpha = (os.clock() - go_hint) * 5 if os.clock() >= go_hint then imgui.PushStyleVarVec2(imgui.StyleVar.WindowPadding, imgui.ImVec2(10, 10)) imgui.PushStyleVarFloat(imgui.StyleVar.Alpha, (alpha <= 1.0 and alpha or 1.0)) imgui.PushStyleColor(imgui.Col.PopupBg, imgui.ImVec4(0.11, 0.11, 0.11, 1.00)) imgui.BeginTooltip() imgui.PushTextWrapPos(460) imgui.PushFont(fonts[18]) imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.ButtonHovered], u8'Подсказка:') imgui.TextUnformatted(text) if action ~= nil then imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.TextDisabled], u8'\n '..action) end if not imgui.IsItemVisible() and imgui.GetStyle().Alpha == 1.0 then go_hint = nil end imgui.PopTextWrapPos() imgui.PopFont() imgui.EndTooltip() imgui.PopStyleColor() imgui.PopStyleVar(2) end end end function Im_Update() local i = NUMWEATHERS * CTimeCycle.GetCurrentHourTimeId() + CurrWeather[0] Im.Hours = new.int(Hours[0]) Im.Mins = new.int(Minutes[0]) Im.Seconds = new.int(Seconds[0]) Im.TimeScale = new.int(TimeScale[0]) Im.AmbRGB = imgui.new.float[3](CTimeCycle.m_nAmbientRed[i] /255, CTimeCycle.m_nAmbientGreen[i] /255, CTimeCycle.m_nAmbientBlue[i] /255) Im.AmbObjRGB = imgui.new.float[3](CTimeCycle.m_nAmbientRed_Obj[i] / 255, CTimeCycle.m_nAmbientGreen_Obj[i] / 255, CTimeCycle.m_nAmbientBlue_Obj[i] / 255) Im.SkyTopRGB = imgui.new.float[3](CTimeCycle.m_nSkyTopRed[i] / 255, CTimeCycle.m_nSkyTopGreen[i] / 255, CTimeCycle.m_nSkyTopBlue[i] / 255) Im.SkyBottomRGB = imgui.new.float[3](CTimeCycle.m_nSkyBottomRed[i] / 255, CTimeCycle.m_nSkyBottomGreen[i] / 255, CTimeCycle.m_nSkyBottomBlue[i] / 255) Im.SunCoreRGB = imgui.new.float[3](CTimeCycle.m_nSunCoreRed[i] / 255, CTimeCycle.m_nSunCoreGreen[i] / 255, CTimeCycle.m_nSunCoreBlue[i] / 255) Im.SunCoronaRGB = imgui.new.float[3](CTimeCycle.m_nSunCoronaRed[i] / 255, CTimeCycle.m_nSunCoronaGreen[i] / 255, CTimeCycle.m_nSunCoronaBlue[i] / 255) Im.SunSz = new.int(CTimeCycle.m_fSunSize[i]) Im.SpriteSz = new.int(CTimeCycle.m_fSpriteSize[i]) Im.SpriteBrght = new.int(CTimeCycle.m_fSpriteBrightness[i]) Im.ShadowStr = new.int(CTimeCycle.m_nShadowStrength[i]) Im.PoleShadowStr = new.int(CTimeCycle.m_nPoleShadowStrength[i]) Im.LightShadowStrength = new.int(CTimeCycle.m_nLightShadowStrength[i]) Im.FarClip = new.int(CTimeCycle.m_fFarClip[i]) Im.FogStart = new.int(CTimeCycle.m_fFogStart[i]) Im.LightsOnGroundBrightness = new.int(CTimeCycle.m_fLightsOnGroundBrightness[i]) Im.LowCloudsRGB = imgui.new.float[3](CTimeCycle.m_nLowCloudsRed[i] / 255, CTimeCycle.m_nLowCloudsGreen[i] / 255, CTimeCycle.m_nLowCloudsBlue[i] / 255) Im.FluffyCloudsBotttomRGB = imgui.new.float[3](CTimeCycle.m_nFluffyCloudsBottomRed[i] / 255, CTimeCycle.m_nFluffyCloudsBottomGreen[i] / 255, CTimeCycle.m_nFluffyCloudsBottomBlue[i] / 255) Im.WaterRGBA = imgui.new.float[4](CTimeCycle.m_fWaterRed[i] / 255, CTimeCycle.m_fWaterGreen[i] / 255, CTimeCycle.m_fWaterBlue[i] / 255, CTimeCycle.m_fWaterAlpha[i] / 255) Im.PostFx1RGBA = imgui.new.float[4](CTimeCycle.m_fPostFx1Red[i] / 255, CTimeCycle.m_fPostFx1Green[i] / 255, CTimeCycle.m_fPostFx1Blue[i] / 255, CTimeCycle.m_fPostFx1Alpha[i] / 255) Im.PostFx2RGBA = imgui.new.float[4](CTimeCycle.m_fPostFx2Red[i] / 255, CTimeCycle.m_fPostFx2Green[i] / 255, CTimeCycle.m_fPostFx2Blue[i] / 255, CTimeCycle.m_fPostFx2Alpha[i] / 255) Im.CloudAlpha = new.int(CTimeCycle.m_fCloudAlpha[i]) Im.HighLightMinIntensity = new.int(CTimeCycle.m_nHighLightMinIntensity[i]) Im.WaterFogAlpha = new.int(CTimeCycle.m_nWaterFogAlpha[i]) Im.DirectionalMult = new.int(CTimeCycle.m_nDirectionalMult[i]) end -- Timecyc Stuff function CTimeCycle.GetCurrentHourTimeId() local h = Hours[0] local id = nil if bTimecyc24h then return h end if h < 5 then id = 0 end if h == 5 then id = 1 end if h == 6 then id = 2 end if 7 <= h and h < 12 then id = 3 end if 12 <= h and h < 19 then id = 4 end if h == 19 then id = 5 end if h == 20 or h == 21 then id = 6 end if h == 22 or h == 23 then id = 7 end return id end function CTimeCycle.SaveToFile(filename) if not doesDirectoryExist(getWorkingDirectory().."\\GameTweaker\\timecyc") then createDirectory(getWorkingDirectory().."\\GameTweaker\\timecyc") end local timecycdat = io.open(getWorkingDirectory().."\\GameTweaker\\timecyc/"..filename .. ".dat", "w") local tc = CTimeCycle -- timecycdat:write("// TimeCycle created using Timecyc24h Editor\n// Be sure to check "..URL.." for updates!\n") for w = 0, NUMWEATHERS - 1 do timecycdat:write("//\n" .. "///////////////////////////////////////////" .. weather[w] .. " \n" .. "//\n") for h = 0, NUMHOURS - 1 do local i = NUMWEATHERS * h + w if bTimecyc24h then if (h >= 12) then if (h == 12) then timecycdat:write("// Midday \n") else timecycdat:write("// " .. (h - 12) .. "PM \n") end else if h == 0 then timecycdat:write("// Midnight \n") else timecycdat:write("// " .. h .. "AM \n") end end else if h == 0 then timecycdat:write("// Midnight\n") end if h == 1 then timecycdat:write("// 5 AM\n") end if h == 2 then timecycdat:write("// 6 AM\n") end if h == 3 then timecycdat:write("// 7 AM\n") end if h == 4 then timecycdat:write("// Midday\n") end if h == 5 then timecycdat:write("// 7 PM\n") end if h == 6 then timecycdat:write("// 8 PM\n") end if h == 7 then timecycdat:write("// 10 PM\n") end end -- timecycdat:write("// "..j.." \n") if (h == 0 or h == 12 and not bTimecyc24h) then timecycdat:write("//\tAmb\t\t\t\t\tAmb_Obj \t\t\t\tDir \t\t\t\t\tSky top\t\t\t\tSky bot\t\t\t\tSunCore\t\t\tSunCorona\t\t\tSunSz\t\tSprSz\tSprBght\t\tShdw\t\t\tLightShd\t\t\tPoleShd\t\t\tFarClp\t\t\tFogSt\t\t\tLightOnGround\t\t\tLowCloudsRGB\t\t\tBottomCloudRGB\t\t\tWaterRGBA\t\t\tAlpha1 RGB1\t\t\tAlpha2 RGB2\t\t\tCloudAlpha\t\t\tIntensityLimit\t\t\tWaterFogAlpha\t\t\tDirMult \n") end timecycdat:write( string.format( "\t%d %d %d \t\t" .. -- AmbRGB "\t%d %d %d \t\t" .. -- AmbObjRGB "\t%d %d %d \t\t" .. -- DirRGB (unused?) "\t%d %d %d \t\t" .. -- SkyTopRGB "\t%d %d %d \t\t" .. -- SkyBotRGB "\t%d %d %d \t\t" .. -- SunCore RGB "\t%d %d %d \t\t" .. -- SunCorona RGB "\t%.1f\t\t%.1f\t\t%.1f\t\t" .. -- SunSz, SpriteSz, SpriteBrightness "\t%d %d %d\t\t" .. -- ShadStrenght, LightShadStreght, PoleShadStrenght "\t%.1f\t\t%.1f\t\t%.1f\t\t" .. -- fFarClip, fFogStart, fLightsOnGroundBrightness "\t%d %d %d\t\t" .. -- LowCloudsRGB "\t%d %d %d\t\t" .. -- FluffyCloudsRGB "\t%d %d %d %d\t\t" .. -- WaterRGBA "\t%d %d %d %d\t\t" .. -- PostFx1ARGB "\t%d %d %d %d\t\t" .. -- PostFx2ARGB "\t%d\t%d\t%d\t%.2f\t\t\n", -- CloudAlpha HiLiMinIntensity WaterFogAlpha DirectionalMult tc.m_nAmbientRed[i], tc.m_nAmbientGreen[i], tc.m_nAmbientBlue[i], tc.m_nAmbientRed_Obj[i], tc.m_nAmbientGreen_Obj[i], tc.m_nAmbientBlue_Obj[i], 255, 255, 255, tc.m_nSkyTopRed[i], tc.m_nSkyTopGreen[i], tc.m_nSkyTopBlue[i], tc.m_nSkyBottomRed[i], tc.m_nSkyBottomGreen[i], tc.m_nSkyBottomBlue[i], tc.m_nSunCoreRed[i],tc.m_nSunCoreGreen[i],tc.m_nSunCoreBlue[i], tc.m_nSunCoronaRed[i], tc.m_nSunCoronaGreen[i], tc.m_nSunCoronaBlue[i], (tc.m_fSunSize[i] - 0.5) / 10.0,(tc.m_fSpriteSize[i] - 0.5) / 10.0,(tc.m_fSpriteBrightness[i] - 0.5) / 10.0, tc.m_nShadowStrength[i],tc.m_nLightShadowStrength[i],tc.m_nPoleShadowStrength[i], tc.m_fFarClip[i],tc.m_fFogStart[i], (tc.m_fLightsOnGroundBrightness[i] - 0.5) / 10.0, tc.m_nLowCloudsRed[i],tc.m_nLowCloudsGreen[i],tc.m_nLowCloudsBlue[i], tc.m_nFluffyCloudsBottomRed[i],tc.m_nFluffyCloudsBottomGreen[i],tc.m_nFluffyCloudsBottomBlue[i], tc.m_fWaterRed[i],tc.m_fWaterGreen[i],tc.m_fWaterBlue[i],tc.m_fWaterAlpha[i], tc.m_fPostFx1Alpha[i],tc.m_fPostFx1Red[i],tc.m_fPostFx1Green[i],tc.m_fPostFx1Blue[i], tc.m_fPostFx2Alpha[i],tc.m_fPostFx2Red[i],tc.m_fPostFx2Green[i],tc.m_fPostFx2Blue[i], tc.m_fCloudAlpha[i],tc.m_nHighLightMinIntensity[i], tc.m_nWaterFogAlpha[i], tc.m_nDirectionalMult[i] / 100.0 ) ) end end io.close(timecycdat) end function SwitchTheStyle(param) param = param or "init" imgui.SwitchContext() local style = imgui.GetStyle() local colors = style.Colors local clr = imgui.Col local ImVec4 = imgui.ImVec4 local ImVec2 = imgui.ImVec2 if param ~= "change" then --==[ STYLE ]==-- imgui.GetStyle().WindowPadding = imgui.ImVec2(3, 3) imgui.GetStyle().FramePadding = imgui.ImVec2(3, 3) imgui.GetStyle().ItemSpacing = imgui.ImVec2(5, 5) imgui.GetStyle().ItemInnerSpacing = imgui.ImVec2(4, 4) imgui.GetStyle().TouchExtraPadding = imgui.ImVec2(4, 4) imgui.GetStyle().IndentSpacing = 2 imgui.GetStyle().ScrollbarSize = 10 imgui.GetStyle().GrabMinSize = 15 style.AntiAliasedLines = true style.AntiAliasedFill = true --==[ BORDER ]==-- imgui.GetStyle().WindowBorderSize = 0 imgui.GetStyle().ChildBorderSize = 2 imgui.GetStyle().PopupBorderSize = 1 imgui.GetStyle().FrameBorderSize = 0 imgui.GetStyle().TabBorderSize = 1 --==[ ROUNDING ]==-- imgui.GetStyle().WindowRounding = 0 imgui.GetStyle().ChildRounding = 0 imgui.GetStyle().FrameRounding = 0 imgui.GetStyle().PopupRounding = 0 imgui.GetStyle().ScrollbarRounding = 0 imgui.GetStyle().GrabRounding = 0 imgui.GetStyle().TabRounding = 0 --==[ ALIGN ]==-- imgui.GetStyle().WindowTitleAlign = imgui.ImVec2(0.5, 0.5) imgui.GetStyle().ButtonTextAlign = imgui.ImVec2(0.5, 0.5) imgui.GetStyle().SelectableTextAlign = imgui.ImVec2(0.5, 0.5) end local eColor = imgui.GetStyle().Colors[imgui.Col.WindowBg] --local eColor = imgui.GetColorU32Vec4(imgui.ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, eColor.w)) colors[clr.WindowBg] = ImVec4(config.ini.WindowBG.r, config.ini.WindowBG.g, config.ini.WindowBG.b, config.ini.WindowBG.a) colors[clr.FrameBg] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.80) colors[clr.FrameBgHovered] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.90) colors[clr.FrameBgActive] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 1.00) colors[clr.CheckMark] = ImVec4(config.ini.ColorText.r, config.ini.ColorText.g, config.ini.ColorText.b, config.ini.ColorText.a) colors[clr.SliderGrab] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 1.80) colors[clr.SliderGrabActive] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 1.00) colors[clr.Button] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.40) colors[clr.ButtonHovered] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.50) colors[clr.ButtonActive] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.70) colors[clr.Header] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.80) colors[clr.HeaderHovered] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.90) colors[clr.HeaderActive] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 1.0) colors[clr.Separator] = colors[clr.Border] colors[clr.SeparatorHovered] = ImVec4(0.26, 0.59, 0.98, 0.78) colors[clr.SeparatorActive] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.ResizeGrip] = ImVec4(0.26, 0.59, 0.98, 0.25) colors[clr.ResizeGripHovered] = ImVec4(0.26, 0.59, 0.98, 0.67) colors[clr.ResizeGripActive] = ImVec4(0.26, 0.59, 0.98, 0.95) colors[clr.TextSelectedBg] = ImVec4(0.26, 0.59, 0.98, 0.35) colors[clr.Text] = ImVec4(config.ini.ColorText.r, config.ini.ColorText.g, config.ini.ColorText.b, config.ini.ColorText.a) colors[clr.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00) colors[clr.ChildBg] = ImVec4(0,0,0,0) colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94) colors[clr.Border] = ImVec4(1.0, 1.0, 1.0, 0.10) colors[clr.BorderShadow] = ImVec4(1.00, 1.00, 1.00, 0.07) colors[clr.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00) colors[clr.ScrollbarBg] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.1) colors[clr.ScrollbarGrab] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.4) colors[clr.ScrollbarGrabHovered] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.5) colors[clr.ScrollbarGrabActive] = ImVec4(config.ini.BaseColor.r, config.ini.BaseColor.g, config.ini.BaseColor.b, 0.7) colors[clr.PlotLines] = ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a) colors[clr.PlotLinesHovered] = ImVec4(config.ini.ColorNavi.r, config.ini.ColorNavi.g, config.ini.ColorNavi.b, config.ini.ColorNavi.a) --ImVec4(config.ini.СolorFoneImg.r, config.ini.СolorFoneImg.g, config.ini.СolorFoneImg.b, config.ini.СolorFoneImg.a) colors[clr.PlotHistogram] = ImVec4(config.ini.СolorChildMenu.r, config.ini.СolorChildMenu.g, config.ini.СolorChildMenu.b, config.ini.СolorChildMenu.a) colors[clr.PlotHistogramHovered] = ImVec4(1.00, 0.80, 0.00, 1.00) colors[clr.ModalWindowDimBg] = ImVec4(0.0, 0.0, 0.0, 0.8); end function onD3DDeviceLost() if config.ini.settings.refreshratefix then writeMemory(0xC9C040+0x30, 4, 0x00, true) end --[[if config.ini.settings.vsync then writeMemory(0xC9C040+0x34, 4, 0, true) end]] if isSampAvailable() then gotofunc("Reflections") gotofunc("InterfaceElementEditor") end end