Нужна помощь с закрытием диалога.

Firus20016

Участник
Автор темы
148
15
Версия MoonLoader
.025-beta
В коде, который должен открывать несколько диалогов и проводить операции по окончанию всех операция не закрывается последний диалог. Пожалуйста, помогите мне это исправить.
(sampCloseCurrentDialogWithButton(button) мне так и не помог)
Так же уточню, что после выполнения работы с диалогом, остается диалог в котором функции серверные не работают.

Lua:
local lsampev, sp           = pcall(require, 'lib.samp.events')
require "lib.moonloader"


function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(1)
        if isKeyJustPressed(109) and sampIsDialogActive(33)  then
            sampSendDialogResponse(33, 1, 5, -1)
            sampSendDialogResponse(881, 1, 0, -1)
        end
        if isKeyJustPressed(107) and sampIsDialogActive(33)  then
            sampSendDialogResponse(33, 1, 11, -1)
            sampSendDialogResponse(7238, 1, 0, -1)
        end
end
end

function sp.onShowDialog(id, style, title, button1, button2, text)
    if id == 882 then
        sampSendDialogResponse(id, 1, 0, -1)
            return false
    end
    if id == 783 then
        sampSendDialogResponse(id, 1, 0, -1)
            return false
    end
end
 
Последнее редактирование:
Решение
В коде, который должен открывать несколько диалогов и проводить операции по окончанию всех операция не закрывается последний диалог. Пожалуйста, помогите мне это исправить.
(sampCloseCurrentDialogWithButton(button) мне так и не помог)
Так же уточню, что после выполнения работы с диалогом, остается диалог в котором функции серверные не работают.

Lua:
local lsampev, sp           = pcall(require, 'lib.samp.events')
require "lib.moonloader"


function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(1)
        if isKeyJustPressed(109) and sampIsDialogActive(33)  then
            sampSendDialogResponse(33, 1, 5, -1)...

wulfandr

Известный
637
260
В коде, который должен открывать несколько диалогов и проводить операции по окончанию всех операция не закрывается последний диалог. Пожалуйста, помогите мне это исправить.
(sampCloseCurrentDialogWithButton(button) мне так и не помог)
Так же уточню, что после выполнения работы с диалогом, остается диалог в котором функции серверные не работают.

Lua:
local lsampev, sp           = pcall(require, 'lib.samp.events')
require "lib.moonloader"


function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(1)
        if isKeyJustPressed(109) and sampIsDialogActive(33)  then
            sampSendDialogResponse(33, 1, 5, -1)
            sampSendDialogResponse(881, 1, 0, -1)
        end
        if isKeyJustPressed(107) and sampIsDialogActive(33)  then
            sampSendDialogResponse(33, 1, 11, -1)
            sampSendDialogResponse(7238, 1, 0, -1)
        end
end
end

function sp.onShowDialog(id, style, title, button1, button2, text)
    if id == 882 then
        sampSendDialogResponse(id, 1, 0, -1)
            return false
    end
    if id == 783 then
        sampSendDialogResponse(id, 1, 0, -1)
            return false
    end
end
Создай какой нибудь пустой и закрой его.