- 75
- 18
- Версия MoonLoader
- .026-beta
как сделать когда человек в круге он стреляет и попадает
полн.код:
require 'lib.moonloader'
local imgui = require 'mimgui'
local memory = require "memory"
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new = imgui.new
local WinState = new.bool()
local checbox = new.bool()
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.Always)
imgui.Begin(u8'222', WinState, imgui.WindowFlags.NoResize)
if imgui.Button(u8("Отчистка чата")) then
memory.fill(sampGetChatInfoPtr() + 306, 0x0, 25200)
memory.write(sampGetChatInfoPtr() + 306, 25562, 4, 0x0)
memory.write(sampGetChatInfoPtr() + 0x63DA, 1, 1)
end
imgui.Checkbox("D", checbox)
imgui.Separator()
imgui.End()
end
)
function main()
while not isSampAvailable() do wait(100) end
while true do wait(0)
if wasKeyPressed(VK_O) and not sampIsCursorActive() then
WinState[0] = not WinState[0]
end
if checbox[0] then
renderFigure2D(650, 355, 100, 100, 0xFFFFFFFF)
end
end
end
function renderFigure2D(x, y, points, radius, color)
local step = math.pi * 2 / points
local render_start, render_end = {}, {}
for i = 0, math.pi * 2, step do
render_start[1] = radius * math.cos(i) + x
render_start[2] = radius * math.sin(i) + y
render_end[1] = radius * math.cos(i + step) + x
render_end[2] = radius * math.sin(i + step) + y
renderDrawLine(render_start[1], render_start[2], render_end[1], render_end[2], 1, color)
end
end