- 72
- 9
- Версия MoonLoader
- .026-beta
Lua:
HotkeyCFGMenu = hotkey.RegisterHotKey('Hotkey CFG Menu', true, decodeJson(settings.hotkey_cfg.bind2), function()
needOpen = true -- Устанавливаем флаг при нажатии клавиши
end)
while true do
wait(0)
if needOpen then
needOpen = false
sampShowDialog(6405, u8:decode"{006AFF}MVD Helper", u8:decode"\n \n", u8:decode("Закрыть"), nil, 2)
while sampIsDialogActive(6405) do wait(100) end
local _, button, list, _ = sampHasDialogRespond(6405)
if list == 0 then
sampAddChatMessage(tag .. u8:decode'Меню закрыто', -1)
end
В случае ниже, точно такая же проблема
Lua:
lua_thread.create(function()
HotkeyCFGMsm = hotkey.RegisterHotKey('Hotkey CFG MSM', false, decodeJson(settings.hotkey_cfg.bind), function()
needStop = true -- Устанавливаем флаг при нажатии клавиши
end)
while true do
wait(0)
if needStop then
needStop = false -- Сбрасываем флаг
if act then
act = false
sampAddChatMessage(tag.. u8:decode'{006AFF}MVD Helper: {FFFFFF}Слежка остановлена!', -1)
end
wait(500) -- Можно использовать wait здесь, так как это в основном потоке
end
end
end)
Последнее редактирование: