- 108
- 6
- Версия MoonLoader
- .027.0-preview
хелп, скрипт не сохраняется, помогите :)
й3ук:
local imgui = require 'mimgui'
local memory = require 'memory'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local renderWindow = imgui.new.bool(false)
local tab = 1
local yourvar = imgui.new.float(1)
local inicfg = require('inicfg')
local iniFilename = 'ParhomenkoSettings.ini'
local ini = inicfg.load({
yourvar = {
yourvar = 1
}
}, iniFilename)
inicfg.save(ini, iniFilename)
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
if doesFileExist(getWorkingDirectory()..'\\Parhomenko\\ParhomenkoHelper\\avatarka.png') then
avatarkaa = imgui.CreateTextureFromFile(getWorkingDirectory() .. '\\Parhomenko\\ParhomenkoHelper\\avatarka.png')
end
theme()
end)
imgui.OnFrame(function() return renderWindow[0] end, function()
local resX, resY = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(750, 290), imgui.Cond.FirstUseEver)
imgui.Begin('##Main', renderWindow, imgui.WindowFlags.NoDecoration)
imgui.BeginChild('##Main2', imgui.ImVec2(115, 275), true)
imgui.Image(avatarkaa, imgui.ImVec2(100, 100))
for numberTab,nameTab in pairs({'Организация','Мероприятия','Прочее', 'Настройки'}) do
if imgui.Button(u8(nameTab), imgui.ImVec2(100,35)) then
tab = numberTab
end
end
imgui.EndChild()
imgui.SetCursorPos(imgui.ImVec2(125, 7))
imgui.BeginChild('##Main3', imgui.ImVec2(617,277), true)
if tab == 1 then
elseif tab == 2 then
elseif tab == 3 then
imgui.PushItemWidth(125)
if imgui.SliderFloat('ASP', yourvar, 0.100, 2) then
memory.setfloat(0xC3EFA4, yourvar[0], true)
inicfg.save(ini, iniFilename)
end
imgui.PopItemWidth()
elseif tab == 4 then
end
imgui.EndChild()
imgui.End()
end)
function main()
while not isSampAvailable() do wait(0) end
memory.fill(0x6FF452, 0x90, 6, true)
memory.setfloat(0xC3EFA4, yourvar[0], true)
sampAddChatMessage('[ {4682B4}PH{ffffff} ] Скрипт успешно активирован!', -1)
sampAddChatMessage('[ {4682B4}PH{ffffff} ] Активация: {4682B4}/ph{ffffff} | Автор: {4682B4}goose', -1)
sampRegisterChatCommand('ph', function()
renderWindow[0] = not renderWindow[0]
end)
wait(-1)
end
function theme()
imgui.SwitchContext()
local style = imgui.GetStyle();
local colors = style.Colors;
style.Alpha = 1;
style.WindowPadding = imgui.ImVec2(8.00, 8.00);
style.WindowRounding = 12;
style.WindowBorderSize = 1;
style.WindowMinSize = imgui.ImVec2(32.00, 32.00);
style.WindowTitleAlign = imgui.ImVec2(0.00, 0.50);
style.ChildRounding = 12;
style.ChildBorderSize = 1;
style.PopupRounding = 12;
style.PopupBorderSize = 1;
style.FramePadding = imgui.ImVec2(4.00, 3.00);
style.FrameRounding = 12;
style.FrameBorderSize = 1;
style.ItemSpacing = imgui.ImVec2(8.00, 4.00);
style.ItemInnerSpacing = imgui.ImVec2(4.00, 4.00);
style.IndentSpacing = 21;
style.ScrollbarSize = 14;
style.ScrollbarRounding = 12;
style.GrabMinSize = 10;
style.GrabRounding = 12;
style.TabRounding = 12;
style.ButtonTextAlign = imgui.ImVec2(0.50, 0.50);
style.SelectableTextAlign = imgui.ImVec2(0.00, 0.00);
colors[imgui.Col.Text] = imgui.ImVec4(1.00, 1.00, 1.00, 1.00);
colors[imgui.Col.TextDisabled] = imgui.ImVec4(0.50, 0.50, 0.50, 1.00);
colors[imgui.Col.WindowBg] = imgui.ImVec4(0.00, 0.00, 0.00, 1.00);
colors[imgui.Col.ChildBg] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00);
colors[imgui.Col.PopupBg] = imgui.ImVec4(0.08, 0.08, 0.08, 0.94);
colors[imgui.Col.Border] = imgui.ImVec4(0.43, 0.43, 0.50, 0.50);
colors[imgui.Col.BorderShadow] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00);
colors[imgui.Col.FrameBg] = imgui.ImVec4(0.16, 0.29, 0.48, 0.54);
colors[imgui.Col.FrameBgHovered] = imgui.ImVec4(0.26, 0.59, 0.98, 0.40);
colors[imgui.Col.FrameBgActive] = imgui.ImVec4(0.26, 0.59, 0.98, 0.67);
colors[imgui.Col.TitleBg] = imgui.ImVec4(0.04, 0.04, 0.04, 1.00);
colors[imgui.Col.TitleBgActive] = imgui.ImVec4(0.16, 0.29, 0.48, 1.00);
colors[imgui.Col.TitleBgCollapsed] = imgui.ImVec4(0.00, 0.00, 0.00, 0.51);
colors[imgui.Col.MenuBarBg] = imgui.ImVec4(0.14, 0.14, 0.14, 1.00);
colors[imgui.Col.ScrollbarBg] = imgui.ImVec4(0.02, 0.02, 0.02, 0.53);
colors[imgui.Col.ScrollbarGrab] = imgui.ImVec4(0.31, 0.31, 0.31, 1.00);
colors[imgui.Col.ScrollbarGrabHovered] = imgui.ImVec4(0.41, 0.41, 0.41, 1.00);
colors[imgui.Col.ScrollbarGrabActive] = imgui.ImVec4(0.51, 0.51, 0.51, 1.00);
colors[imgui.Col.CheckMark] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00);
colors[imgui.Col.SliderGrab] = imgui.ImVec4(0.24, 0.52, 0.88, 1.00);
colors[imgui.Col.SliderGrabActive] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00);
colors[imgui.Col.Button] = imgui.ImVec4(0.26, 0.59, 0.98, 0.40);
colors[imgui.Col.ButtonHovered] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00);
colors[imgui.Col.ButtonActive] = imgui.ImVec4(0.06, 0.53, 0.98, 1.00);
colors[imgui.Col.Header] = imgui.ImVec4(0.26, 0.59, 0.98, 0.31);
colors[imgui.Col.HeaderHovered] = imgui.ImVec4(0.26, 0.59, 0.98, 0.80);
colors[imgui.Col.HeaderActive] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00);
colors[imgui.Col.Separator] = imgui.ImVec4(0.43, 0.43, 0.50, 0.50);
colors[imgui.Col.SeparatorHovered] = imgui.ImVec4(0.10, 0.40, 0.75, 0.78);
colors[imgui.Col.SeparatorActive] = imgui.ImVec4(0.10, 0.40, 0.75, 1.00);
colors[imgui.Col.ResizeGrip] = imgui.ImVec4(0.26, 0.59, 0.98, 0.25);
colors[imgui.Col.ResizeGripHovered] = imgui.ImVec4(0.26, 0.59, 0.98, 0.67);
colors[imgui.Col.ResizeGripActive] = imgui.ImVec4(0.26, 0.59, 0.98, 0.95);
colors[imgui.Col.Tab] = imgui.ImVec4(0.18, 0.35, 0.58, 0.86);
colors[imgui.Col.TabHovered] = imgui.ImVec4(0.26, 0.59, 0.98, 0.80);
colors[imgui.Col.TabActive] = imgui.ImVec4(0.20, 0.41, 0.68, 1.00);
colors[imgui.Col.TabUnfocused] = imgui.ImVec4(0.07, 0.10, 0.15, 0.97);
colors[imgui.Col.TabUnfocusedActive] = imgui.ImVec4(0.14, 0.26, 0.42, 1.00);
colors[imgui.Col.PlotLines] = imgui.ImVec4(0.61, 0.61, 0.61, 1.00);
colors[imgui.Col.PlotLinesHovered] = imgui.ImVec4(1.00, 0.43, 0.35, 1.00);
colors[imgui.Col.PlotHistogram] = imgui.ImVec4(0.90, 0.70, 0.00, 1.00);
colors[imgui.Col.PlotHistogramHovered] = imgui.ImVec4(1.00, 0.60, 0.00, 1.00);
colors[imgui.Col.TextSelectedBg] = imgui.ImVec4(0.26, 0.59, 0.98, 0.35);
colors[imgui.Col.DragDropTarget] = imgui.ImVec4(1.00, 1.00, 0.00, 0.90);
colors[imgui.Col.NavHighlight] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00);
colors[imgui.Col.NavWindowingHighlight] = imgui.ImVec4(1.00, 1.00, 1.00, 0.70);
colors[imgui.Col.NavWindowingDimBg] = imgui.ImVec4(0.80, 0.80, 0.80, 0.20);
colors[imgui.Col.ModalWindowDimBg] = imgui.ImVec4(0.80, 0.80, 0.80, 0.35);
end