- Версия MoonLoader
- .026-beta
не работает функция с диалогом, вообще, хелпайте плес.
Lua:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local raknet = require 'lib.samp.raknet'
sampev.INTERFACE.INCOMING_RPCS[raknet.RPC.SHOWDIALOG] = {
'onShowDialog',
{dialogId = 'int16'},
{style = 'int8'},
{title = 'string8'},
{button1 = 'string8'},
{button2 = 'string8'},
{text = 'encodedString4096'},
{jsonPayload = 'string16'}
}
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('ctt', ctt)
while true do
wait(0)
end
end
function ctt()
local did = 34400
lua_thread.create(function()
sampShowDialog(did, "{6495ED}Тест", "{ffffff}Один\nДва", "Выбрать", "Закрыть", 2)
while sampIsDialogActive(did) do wait(100) end
local _, button, list, _ = sampHasDialogRespond(did)
if button == 1 then
if list == 0 then
sampAddChatMessage('Пункт номер 1', -1)
elseif list == 1 then
sampAddChatMessage('Пункт номер 2', -1)
end
end
end)
end