require("lib.moonloader")
local k = require("vkeys")
local imgui = require("imgui")
local memory = require("memory")
local encoding = require("encoding")
encoding.default = "CP1251"
u8 = encoding.UTF8
local sampev = require ('lib.samp.events')
local themes = import("resource/imgui_themes.lua")
local tag = "[admin tools script]: "
local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)
local pages = {
{
name = "1 вкладка" ,
text = {
'test',
'не test'
}
},
{
name = "2 вкладка",
text = {
"кнопка во второй вкладке",
"Заебал ебать мозг"
}
}
}
local currentPage = 1
function main()
while not isSampAvailable() do wait(100) end
sampAddChatMessage(tag .. "{FFFFFF}успешно загружен!", 0xB23AD4)
sampRegisterChatCommand("cmenu", cmd_cmenu)
imgui.Process = false
imgui.SwitchContext()
--themes.SwitchColorTheme(8)
while true do wait(0)
imgui.Process = main_window_state.v
_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)
fps = memory.getfloat(0xB7CB50, true)
if isKeyJustPressed(k.VK_DELETE) then
sampAddChatMessage(tag .. "{FFFFFF}Ваш ID: " .. id, 0xB23AD4)
sampAddChatMessage(tag .. "{FFFFFF}Ваш NickName: " .. nick, 0xB23AD4)
sampAddChatMessage(tag .. "{FFFFFF}Ваш Fps: " .. fps, 0xB23AD4)
end
end
end
function cmd_cmenu()
main_window_state.v = not main_window_state.v
end
function imgui.OnDrawFrame()
local X, Y = getScreenResolution()
imgui.SetNextWindowSize(imgui.ImVec2(630, 320), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2(X / 2, Y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin("Admin Tools", main_window_state)
local arg = 1
for i, page in ipairs(pages) do
if imgui.Button( u8(page.name) ) then
currentPage = i
end
imgui.SameLine()
imgui[currentPage == 1 and 'Text' or 'Button'](u8(pages[currentPage]['text'][arg]))
arg = arg +1
end
arg = 1
imgui.End()
end