Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.76 KB | None | 0 0
  1. local imgui = require("imgui")
  2. local x2, y2 = getScreenResolution()
  3. local checkbox = imgui.ImBool(false)
  4. local encoding = require ("encoding")
  5. local checkbox222 = imgui.ImBool(false)
  6. local checkbox333 = imgui.ImBool(false)
  7. local traser = imgui.ImBool(false)
  8. local enab = imgui.ImBool(false)
  9. local checkbox123 = imgui.ImBool(false)
  10. local inicfg = require("inicfg")
  11. encoding.default = "CP1251"
  12. u8 = encoding.UTF8
  13. local inputs11 = {
  14. tabl = {
  15. 121212, 1221
  16. }
  17. }
  18. tabl = {}
  19. local style = imgui.GetStyle()
  20. local colors = style.Colors
  21. local clr = imgui.Col
  22. local ImVec4 = imgui.ImVec4
  23. colors[clr.TitleBg] = ImVec4(255, 0, 0, 1)
  24. colors[clr.TitleBgActive] = ImVec4(255, 0, 0, 1)
  25. colors[clr.TitleBgCollapsed] = ImVec4(255, 0, 0, 0.1)
  26. function main()
  27. while not isSampAvailable() do wait(100) end
  28. local font = renderCreateFont("Arial", 7, 4)
  29. sampRegisterChatCommand("renderob", function() enab.v = not enab.v end)
  30. if not doesDirectoryExist("moonloader//config") then
  31. createDirectory("moonloader//config")
  32. inicfg.save(inputs11, "objwallhack")
  33. end
  34. inputs = inicfg.load(nil, "objwallhack")
  35. if inputs == nil then
  36. inicfg.save(inputs11, "objwallhack")
  37. inputs = inicfg.load(nil, "objwallhack")
  38. end
  39. for _, val in ipairs(inputs.tabl) do
  40. table.insert(tabl,imgui.ImInt(val))
  41. end
  42. while true do
  43. wait(0)
  44. imgui.Process = enab.v
  45. for _, v in pairs(getAllObjects()) do
  46. local asd
  47. if sampGetObjectSampIdByHandle(v) ~= -1 then
  48. asd = sampGetObjectSampIdByHandle(v)
  49. end
  50. if isObjectOnScreen(v) then
  51. local _, x, y, z = getObjectCoordinates(v)
  52. local x1, y1 = convert3DCoordsToScreen(x,y,z)
  53. local model = getObjectModel(v)
  54. local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
  55. local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
  56.  
  57. if checkbox.v then
  58. renderFontDrawText(font, checkbox222.v and asd and "model = "..model.."; id = "..asd or "model = "..model, x1, y1, -1)
  59. if traser.v then
  60. renderDrawLine(x10, y10, x1, y1, 1.0, -1)
  61. end
  62. elseif checkbox123.v then
  63. for _, v2 in ipairs(tabl) do
  64. if v2.v == model then
  65. renderFontDrawText(font, checkbox333.v and asd and "model = "..model.."; id = "..asd or "model = "..model, x1, y1, -1)
  66. if traser.v then
  67. renderDrawLine(x10, y10, x1, y1, 1.0, -1)
  68. end
  69. end
  70. end
  71. end
  72. end
  73. end
  74. end
  75. end
  76.  
  77. local intbuffer = imgui.ImInt(0)
  78.  
  79. function imgui.OnDrawFrame()
  80. if enab.v then
  81. imgui.SetNextWindowPos(imgui.ImVec2(x2 / 2, y2 / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
  82. imgui.SetNextWindowSize(imgui.ImVec2(300, 400), imgui.Cond.FirstUseEver)
  83. imgui.Begin("Render objects", enab,imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.AlwaysUseWindowPadding + imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysUseWindowPadding)
  84. imgui.Checkbox(u8("Найти все объекты"), checkbox)
  85. if checkbox.v then
  86. imgui.SameLine()
  87. imgui.Checkbox(u8("Писать id рядом с моделью"), checkbox222)
  88. end
  89. imgui.Checkbox(u8("Найти объекты по условиям"), checkbox123)
  90. if checkbox123.v then
  91. imgui.SameLine()
  92. imgui.Checkbox(u8("Писать id рядом с моделью"), checkbox333)
  93. end
  94. imgui.Checkbox(u8("Включить трейсер"), traser)
  95. imgui.InputInt(u8("Удалить объект (визуально)"), intbuffer, 0)
  96. if intbuffer.v ~= 0 then
  97. imgui.SameLine()
  98. if (imgui.Button(u8("Удалить")) and sampGetObjectHandleBySampId(intbuffer.v) ~= -1) then
  99. deleteObject(sampGetObjectHandleBySampId(intbuffer.v))
  100. intbuffer.v = 0
  101. end
  102. end
  103. if imgui.Button(u8("Добавить новое условие")) then
  104. table.insert(inputs.tabl, #inputs.tabl + 1)
  105. table.insert(tabl, imgui.ImInt(#tabl + 1))
  106. inicfg.save(inputs, "objwallhack")
  107. end--
  108. if #inputs.tabl > 0 then
  109. if imgui.Button(u8("Удалить последнее условие")) then
  110. table.remove(tabl, #tabl)
  111. table.remove(inputs.tabl, #inputs.tabl)
  112. inicfg.save(inputs, "objwallhack")
  113. end
  114. end
  115. imgui.BeginChild("inputs", imgui.ImVec2(387, 240), true)
  116. for i, val in ipairs(tabl) do
  117. if imgui.InputInt("input"..i, val, 0, -1) then
  118. inputs.tabl[i] = tabl[i].v
  119. inicfg.save(inputs, "objwallhack")
  120. end
  121. end
  122. imgui.EndChild()
  123. imgui.End()
  124. end
  125. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement