Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local imgui = require("imgui")
- local x2, y2 = getScreenResolution()
- local checkbox = imgui.ImBool(false)
- local encoding = require ("encoding")
- local checkbox222 = imgui.ImBool(false)
- local checkbox333 = imgui.ImBool(false)
- local traser = imgui.ImBool(false)
- local enab = imgui.ImBool(false)
- local checkbox123 = imgui.ImBool(false)
- local inicfg = require("inicfg")
- encoding.default = "CP1251"
- u8 = encoding.UTF8
- local inputs11 = {
- tabl = {
- 121212, 1221
- }
- }
- tabl = {}
- local style = imgui.GetStyle()
- local colors = style.Colors
- local clr = imgui.Col
- local ImVec4 = imgui.ImVec4
- colors[clr.TitleBg] = ImVec4(255, 0, 0, 1)
- colors[clr.TitleBgActive] = ImVec4(255, 0, 0, 1)
- colors[clr.TitleBgCollapsed] = ImVec4(255, 0, 0, 0.1)
- function main()
- while not isSampAvailable() do wait(100) end
- local font = renderCreateFont("Arial", 7, 4)
- sampRegisterChatCommand("renderob", function() enab.v = not enab.v end)
- if not doesDirectoryExist("moonloader//config") then
- createDirectory("moonloader//config")
- inicfg.save(inputs11, "objwallhack")
- end
- inputs = inicfg.load(nil, "objwallhack")
- if inputs == nil then
- inicfg.save(inputs11, "objwallhack")
- inputs = inicfg.load(nil, "objwallhack")
- end
- for _, val in ipairs(inputs.tabl) do
- table.insert(tabl,imgui.ImInt(val))
- end
- while true do
- wait(0)
- imgui.Process = enab.v
- for _, v in pairs(getAllObjects()) do
- local asd
- if sampGetObjectSampIdByHandle(v) ~= -1 then
- asd = sampGetObjectSampIdByHandle(v)
- end
- if isObjectOnScreen(v) then
- local _, x, y, z = getObjectCoordinates(v)
- local x1, y1 = convert3DCoordsToScreen(x,y,z)
- local model = getObjectModel(v)
- local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
- local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
- if checkbox.v then
- renderFontDrawText(font, checkbox222.v and asd and "model = "..model.."; id = "..asd or "model = "..model, x1, y1, -1)
- if traser.v then
- renderDrawLine(x10, y10, x1, y1, 1.0, -1)
- end
- elseif checkbox123.v then
- for _, v2 in ipairs(tabl) do
- if v2.v == model then
- renderFontDrawText(font, checkbox333.v and asd and "model = "..model.."; id = "..asd or "model = "..model, x1, y1, -1)
- if traser.v then
- renderDrawLine(x10, y10, x1, y1, 1.0, -1)
- end
- end
- end
- end
- end
- end
- end
- end
- local intbuffer = imgui.ImInt(0)
- function imgui.OnDrawFrame()
- if enab.v then
- imgui.SetNextWindowPos(imgui.ImVec2(x2 / 2, y2 / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
- imgui.SetNextWindowSize(imgui.ImVec2(300, 400), imgui.Cond.FirstUseEver)
- imgui.Begin("Render objects", enab,imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.AlwaysUseWindowPadding + imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysUseWindowPadding)
- imgui.Checkbox(u8("Найти все объекты"), checkbox)
- if checkbox.v then
- imgui.SameLine()
- imgui.Checkbox(u8("Писать id рядом с моделью"), checkbox222)
- end
- imgui.Checkbox(u8("Найти объекты по условиям"), checkbox123)
- if checkbox123.v then
- imgui.SameLine()
- imgui.Checkbox(u8("Писать id рядом с моделью"), checkbox333)
- end
- imgui.Checkbox(u8("Включить трейсер"), traser)
- imgui.InputInt(u8("Удалить объект (визуально)"), intbuffer, 0)
- if intbuffer.v ~= 0 then
- imgui.SameLine()
- if (imgui.Button(u8("Удалить")) and sampGetObjectHandleBySampId(intbuffer.v) ~= -1) then
- deleteObject(sampGetObjectHandleBySampId(intbuffer.v))
- intbuffer.v = 0
- end
- end
- if imgui.Button(u8("Добавить новое условие")) then
- table.insert(inputs.tabl, #inputs.tabl + 1)
- table.insert(tabl, imgui.ImInt(#tabl + 1))
- inicfg.save(inputs, "objwallhack")
- end--
- if #inputs.tabl > 0 then
- if imgui.Button(u8("Удалить последнее условие")) then
- table.remove(tabl, #tabl)
- table.remove(inputs.tabl, #inputs.tabl)
- inicfg.save(inputs, "objwallhack")
- end
- end
- imgui.BeginChild("inputs", imgui.ImVec2(387, 240), true)
- for i, val in ipairs(tabl) do
- if imgui.InputInt("input"..i, val, 0, -1) then
- inputs.tabl[i] = tabl[i].v
- inicfg.save(inputs, "objwallhack")
- end
- end
- imgui.EndChild()
- imgui.End()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement