- 50
- 11
Прив,
Ошибка в коде когда делал буттоны
Ошибка и код ниже
Ошибка в коде когда делал буттоны
Ошибка и код ниже
Ошибка:
[error] [Безымянный.lua] ./Безымянный.lua:81: ')' expected (to close '(' at line 21) near 'imgui'
Да:
script_name('Anti-KPZ')
script_version('1.0')
script_version_number(1)
script_author('Ктота.')
script_description('Много Функций чтобы избежать Тюряги.')
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local WinState = imgui.new.bool()
local checkboxone = imgui.new.bool(false) -- создём буффер для чекбокса, который возвращает true/false
local new = imgui.new -- создаём короткий псевдоним для удобства
local WinState = new.bool() -- создаём буффер для открытия окна
local flesh = false
local checkboxtwo = imgui.new.bool(false)
local nofall = false
local checkboxthree = imgui.new.bool(false)
local checkboxfour = imgui.new.bool(false)
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(245, 280), imgui.Cond.FirstUseEver)
imgui.Begin(u8'Пример', WinState)
if imgui.BeginTabBar('Tabs') then
if imgui.BeginTabItem(u8'Первая') then -- задаём название первой вкладки
-- далее идёт содержимое вкладки
if imgui.Checkbox(u8'NoBike', checkboxone) then
setCharCanBeKnockedOffBike(1, checkboxone[0])
end
imgui.SameLine()
if nofall then
if imgui.Checkbox(u8"Сбив Падения ", checkboxthree) then
nofall = false
end
else
if imgui.Checkbox(u8"Сбив Падения ", checkboxthree) then
nofall = true
end
end
end
if nofall then -- no falltaskPlayAnim(playerPed HANDSUP PED 4.0 0 0 0 0 4)
if isCharPlayingAnim(playerPed, 'KO_SKID_BACK') or isCharPlayingAnim(playerPed, 'FALL_COLLAPSE') then
clearCharTasksImmediately(playerPed)
end
end
imgui.SameLine()
if flesh then
if imgui.Checkbox(u8"Режим Флеша", checkboxtwo) then
flesh = false
end
else
if imgui.Checkbox(u8"Режим Флеша", checkboxtwo) then
flesh = true
end
end
if(flesh) then
setCharAnimSpeed(PLAYER_PED, "RUN_CIVI" , 2.5)
setCharAnimSpeed(PLAYER_PED, "RUN_OLD" , 2.5)
setCharAnimSpeed(PLAYER_PED, "RUN_FATOLD" , 2.5)
setCharAnimSpeed(PLAYER_PED, "RUN_FAT" , 2.3)
setCharAnimSpeed(PLAYER_PED, "WOMAN_RUNSEXY" , 2.3)
setCharAnimSpeed(PLAYER_PED, "WOMAN_RUNFATOLD" , 2.3)
setCharAnimSpeed(PLAYER_PED, "WOMAN_RUNBUSY" , 2.5)
setCharAnimSpeed(PLAYER_PED, "WOMAN_RUN" , 2.3)
setCharAnimSpeed(PLAYER_PED, "SWAT_RUN" , 2.3)
setCharAnimSpeed(PLAYER_PED, "RUN_PLAYER" , 2.3)
setCharAnimSpeed(PLAYER_PED, "RUN_GANGI" , 2.5)
end
-- конец 111111111
imgui.EndTabItem()
end
if imgui.BeginTabItem(u8'Вторая') then -- задаём название второй вкладки
-- далее идёт содержимое вкладки
imgui.Text(u8'Да')
-- конец содержимого вкладки 22222222
imgui.EndTabItem()
end
imgui.EndTabBar()
end
imgui.End()
end)
function main()
sampRegisterChatCommand('kpz', function() WinState[0] = not WinState[0] end)
wait(-1)
end
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil;
Tema()
end)
--ТЕМА
function Tema()
imgui.SwitchContext()
imgui.GetStyle().FramePadding = imgui.ImVec2(3.5, 3.5)
imgui.GetStyle().FrameRounding = 3
imgui.GetStyle().ChildRounding = 2
imgui.GetStyle().WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
imgui.GetStyle().WindowRounding = 2
imgui.GetStyle().ItemSpacing = imgui.ImVec2(5.0, 4.0)
imgui.GetStyle().ScrollbarSize = 15.0
imgui.GetStyle().ScrollbarRounding = 0
imgui.GetStyle().GrabMinSize = 8.0
imgui.GetStyle().GrabRounding = 1.0
imgui.GetStyle().WindowPadding = imgui.ImVec2(4.0, 4.0)
imgui.GetStyle().ButtonTextAlign = imgui.ImVec2(0.0, 0.5)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = imgui.ImVec4(0.14, 0.12, 0.16, 1.00)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = imgui.ImVec4(0.30, 0.20, 0.39, 0.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = imgui.ImVec4(0.05, 0.05, 0.10, 0.90)
imgui.GetStyle().Colors[imgui.Col.Border] = imgui.ImVec4(0.89, 0.85, 0.92, 0.30)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = imgui.ImVec4(0.30, 0.20, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.68)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = imgui.ImVec4(0.41, 0.19, 0.63, 0.45)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = imgui.ImVec4(0.41, 0.19, 0.63, 0.35)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = imgui.ImVec4(0.30, 0.20, 0.39, 0.57)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = imgui.ImVec4(0.30, 0.20, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = imgui.ImVec4(0.41, 0.19, 0.63, 0.31)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = imgui.ImVec4(0.56, 0.61, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = imgui.ImVec4(0.41, 0.19, 0.63, 0.24)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = imgui.ImVec4(0.41, 0.19, 0.63, 0.44)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.86)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = imgui.ImVec4(0.64, 0.33, 0.94, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = imgui.ImVec4(0.41, 0.19, 0.63, 0.76)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.86)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = imgui.ImVec4(0.41, 0.19, 0.63, 0.20)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = imgui.ImVec4(0.89, 0.85, 0.92, 0.63)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogram] = imgui.ImVec4(0.89, 0.85, 0.92, 0.63)
imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextSelectedBg] = imgui.ImVec4(0.41, 0.19, 0.63, 0.43)
end
------------------------------------------------