- 44
- 2
- Версия SA-MP
-
- Другая
[error] [lua inv.lua] ./lua inv.lua:88: attempt to index global 'clr' (a nil value)
stack traceback:
./lua inv.lua:88: in function 'Theme'
./lua inv.lua:130: in function 'cb'
./lib/mimgui/init.lua:79: in function 'InitializeRenderer'
./lib/mimgui/init.lua:87: in function <./lib/mimgui/init.lua:84>
помогите пж я новичок пишу скрипты на телефоне
stack traceback:
./lua inv.lua:88: in function 'Theme'
./lua inv.lua:130: in function 'cb'
./lib/mimgui/init.lua:79: in function 'InitializeRenderer'
./lib/mimgui/init.lua:87: in function <./lib/mimgui/init.lua:84>
помогите пж я новичок пишу скрипты на телефоне
lua:
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local WinState = imgui.new.bool()
local tab = 1
imgui.OnFrame(function() return WinState[0] end, function(player)
imgui.SetNextWindowPos(imgui.ImVec2(500, 500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(800, 650), imgui.Cond.Always)
imgui.Begin(u8'qqw & Lan', WinState, imgui.WindowFlags.NoResize)
for numberTab,nameTab in pairs({'Персонаж','Машина','Авторы'}) do
if imgui.Button(u8(nameTab), imgui.ImVec2(200,180)) then
tab = numberTab
end
end
imgui.SetCursorPos(imgui.ImVec2(210, 40))
if imgui.BeginChild('Name##'..tab, imgui.ImVec2(600, 580), true) then
if tab == 1 then
imgui.Text(u8'Инвиз с ног.')
if imgui.Button(u8'Кнопка 1') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 2') then
sampAddChatMessage('Успешно!', -1)
end
if imgui.Button(u8'Кнопка 3') then
sampAddChatMessage('Успешно!', -1)
end
if imgui.Button(u8'Кнопка 4') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 5') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 6') then
sampAddChatMessage('Успешно! ', -1)
end
elseif tab == 2 then
imgui.Text(u8'Инвиз в машине')
if imgui.Button(u8'Кнопка 1') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 2') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 3') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 4') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 5') then
sampAddChatMessage('Успешно! ', -1)
end
if imgui.Button(u8'Кнопка 6') then
sampAddChatMessage('Успешно! ', -1)
end
elseif tab == 3 then
imgui.Text(u8'menu -> qqw')
imgui.Text(u8'script -> lan')
if imgui.Button(u8'наши тг') then
sampAddChatMessage('tg - qqw tg - Lan '..tab, -1)
end
end
imgui.EndChild()
end
imgui.End()
end)
-- раздал опиума
function imgui.Theme()
imgui.SwitchContext()
style = imgui.GetStyle()
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.FrameRounding = 3
style.ItemSpacing = imgui.ImVec2(5.0, 4.0)
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 0
style.GrabMinSize = 8.0
style.GrabRounding = 1.0
style.WindowPadding = imgui.ImVec2(4.0, 4.0)
style.FramePadding = imgui.ImVec2(3.5, 3.5)
style.ButtonTextAlign = imgui.ImVec2(0.0, 0.5)
colors[clr.WindowBg] = ImVec4(0.14, 0.12, 0.16, 1.00);
colors[clr.ChildWindowBg] = ImVec4(0.30, 0.20, 0.39, 0.00);
colors[clr.PopupBg] = ImVec4(0.05, 0.05, 0.10, 0.90);
colors[clr.Border] = ImVec4(0.89, 0.85, 0.92, 0.30);
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00);
colors[clr.FrameBg] = ImVec4(0.30, 0.20, 0.39, 1.00);
colors[clr.FrameBgHovered] = ImVec4(0.41, 0.19, 0.63, 0.68);
colors[clr.FrameBgActive] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.TitleBg] = ImVec4(0.41, 0.19, 0.63, 0.45);
colors[clr.TitleBgCollapsed] = ImVec4(0.41, 0.19, 0.63, 0.35);
colors[clr.TitleBgActive] = ImVec4(0.41, 0.19, 0.63, 0.78);
colors[clr.MenuBarBg] = ImVec4(0.30, 0.20, 0.39, 0.57);
colors[clr.ScrollbarBg] = ImVec4(0.30, 0.20, 0.39, 1.00);
colors[clr.ScrollbarGrab] = ImVec4(0.41, 0.19, 0.63, 0.31);
colors[clr.ScrollbarGrabHovered] = ImVec4(0.41, 0.19, 0.63, 0.78);
colors[clr.ScrollbarGrabActive] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.ComboBg] = ImVec4(0.30, 0.20, 0.39, 1.00);
colors[clr.CheckMark] = ImVec4(0.56, 0.61, 1.00, 1.00);
colors[clr.SliderGrab] = ImVec4(0.41, 0.19, 0.63, 0.24);
colors[clr.SliderGrabActive] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.Button] = ImVec4(0.41, 0.19, 0.63, 0.44);
colors[clr.ButtonHovered] = ImVec4(0.41, 0.19, 0.63, 0.86);
colors[clr.ButtonActive] = ImVec4(0.64, 0.33, 0.94, 1.00);
colors[clr.Header] = ImVec4(0.41, 0.19, 0.63, 0.76);
colors[clr.HeaderHovered] = ImVec4(0.41, 0.19, 0.63, 0.86);
colors[clr.HeaderActive] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.ResizeGrip] = ImVec4(0.41, 0.19, 0.63, 0.20);
colors[clr.ResizeGripHovered] = ImVec4(0.41, 0.19, 0.63, 0.78);
colors[clr.ResizeGripActive] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.CloseButton] = ImVec4(1.00, 1.00, 1.00, 0.75);
colors[clr.CloseButtonHovered] = ImVec4(0.88, 0.74, 1.00, 0.59);
colors[clr.CloseButtonActive] = ImVec4(0.88, 0.85, 0.92, 1.00);
colors[clr.PlotLines] = ImVec4(0.89, 0.85, 0.92, 0.63);
colors[clr.PlotLinesHovered] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.PlotHistogram] = ImVec4(0.89, 0.85, 0.92, 0.63);
colors[clr.PlotHistogramHovered] = ImVec4(0.41, 0.19, 0.63, 1.00);
colors[clr.TextSelectedBg] = ImVec4(0.41, 0.19, 0.63, 0.43);
colors[clr.ModalWindowDarkening] = ImVec4(0.20, 0.20, 0.20, 0.35);
end
imgui.OnInitialize(function()
imgui.Theme()
end)
function main()
sampRegisterChatCommand('offset',function() WinState[0] = not WinState[0] end)
wait(-1)
end