require "lib.moonloader"
local on = require "lib.samp.events"
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand("xz",aa)
while not isSampAvailable() do wait(100) end
while true do
wait(0)
end
end
local da = "выкл"
function aa()
lua_thread.create(function()
if da == "вкл" then
sampShowDialog(6405, "xz", "текст 1 ["..da.."]\nlol", "ok", "neok", DIALOG_STYLE_LIST)
while sampIsDialogActive(6405) do wait(100) end
local _, button, list, _ = sampHasDialogRespond(6405)
da = "выкл"
if button == 1 and list == 0 then
sampAddChatMessage("da",-1)
sampShowDialog(6405, "xz", "текст 1 ["..da.."]\nlol", "ok", "neok", DIALOG_STYLE_LIST)
return false
else --выкл
sampAddChatMessage("dial close",-1)
end
end
if da == "выкл" then
sampShowDialog(6405, "xz", "текст 1 ["..da.."]\nlol", "ok", "neok", DIALOG_STYLE_LIST)
while sampIsDialogActive(6405) do wait(100) end
local _, button, list, _ = sampHasDialogRespond(6405)
da = "вкл"
if button == 1 and list == 0 then
sampAddChatMessage("da",-1)
sampShowDialog(6405, "xz", "текст 1 ["..da.."]\nlol", "ok", "neok", DIALOG_STYLE_LIST)
return false
else --close диалога
sampAddChatMessage("dial close",-1)
end
end
end)
end