- 75
- 2
- Версия MoonLoader
- .026-beta
Имеется код, но почему-то на диалог с тайтлом '{0099CC}Меню игрока' отвечать не хочет, а на '{FFCD00}Связь с администрацией' отвечает, в чем проблема?
source:
local sampev = require 'lib.samp.events'
local x = false
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('rep', fastrep)
wait(-1)
end
function fastrep(arg)
sampSendChat('/mn')
x = true
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if title == '{0099CC}Меню игрока' and x then
sampSendDialogResponse(dialogId, 1, 5, nil)
return false
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if title == '{FFCD00}Связь с администрацией' and x then
sampSendDialogResponse(dialogId, 1, 65535, arg)
x = false
return false
end
end
function sampev.onSendDialogResponse(dialogId, button, listboxId, input)
sampAddChatMessage('ID = '..dialogId.. ' | button = '..button..' | listboxId = '..listboxId..' | input = '..input, -1)
end