Lua:
require "lib.moonloader"
local sampev = require "lib.samp.events"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
imgui.Process = false
while true do
wait(0)
if main_window_state.v == false then
imgui.Process = false
end
end
end
function sampev.onShowDialog(dialogid, dialogstyle, title, b1, b2, text)
if dialogid == 14 and dialogstyle == 1 then
playerId, var = text:match(".+%[(%d+)%]%s+(.+)")
nickname = sampGetPlayerNickname(playerId)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end
end
function imgui.OnDrawFrame()
if dialogid == 14 and dialogstyle == 1 then
imgui.Begin(u8"Заголовок")
if imgui.Button(u8"Передать текст") then
sampAddChatMessage("Розыск: " .. nickname .. "[" .. playerId .. "]: " .. var, -1)
imgui.End()
end
end
end
При открытии диалога с ID 14 не высвечивается imgui. В чём может быть проблема?