- 478
- 20
помогите с созданием ГМа, код ниже
Lua:
local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local checkinfobar = imgui.ImBool()
local checkdopinfobar = imgui.ImBool()
local themes = import "resource/imgui_themes.lua"
local window = imgui.ImBool(false)
local settings = {
enabled = imgui.ImBool(true),
line = imgui.ImBool(true),
info = imgui.ImBool(true),
}
local font = renderCreateFont('Arial Black', 10, 5)
function main()
while not isSampAvailable() do wait(200) end
-- открытие меню
sampRegisterChatCommand('ch', function() window.v = not window.v end)
imgui.Process = false
window.v = true --show window
imgui.SwitchContext()
themes.SwitchColorTheme(5)
while true do
wait(0)
imgui.Process = window.v
if settings.enabled.v then
for k, v in pairs(getAllChars()) do
local myX, myY, myZ = getCharCoordinates(PLAYER_PED)
local x, y, z = getCharCoordinates(v)
local r_myX, r_myY = convert3DCoordsToScreen(myX, myY, myZ)
local r_X, r_Y = convert3DCoordsToScreen(x, y, z)
if settings.line.v then
if v ~= PLAYER_PED and isCharOnScreen(v) then
renderDrawLine(r_myX, r_myY, r_X, r_Y, 3, 0xFFff004d)
end
end
if settings.info.v then
if v ~= PLAYER_PED and isCharOnScreen(v) then
_, id = sampGetPlayerIdByCharHandle(v)
renderFontDrawText(font, 'ID: '..id..'\nNick: '..sampGetPlayerNickname(id)..'\nHP: '..getCharHealth(v)..'\nARM: '..getCharArmour(v), r_X, r_Y, 0xFFFFFFFF, 0x90000000)
end
end
end
end
end
end
function imgui.OnDrawFrame()
if window.v then
imgui.SetNextWindowPos(imgui.ImVec2(650.0, 250.0), imgui.Cond.FirstUseEver)
imgui.SetNextWindowSize(imgui.ImVec2(280.0, 70.0), imgui.Cond.FirstUseEver)
imgui.Begin('Multi-Cheat Menu | By Han', window)
imgui.Checkbox(u8'Включить WallHack', settings.enabled)
imgui.Checkbox(u8'Линия к игрокам', settings.line)
imgui.Checkbox(u8'Информация о игроках', settings.info)
imgui.Checkbox(u8"Инфобар", checkinfobar)
imgui.Checkbox(u8"Дополнение к инфобару", checkdopinfobar)
imgui.End()
end
end