require 'lib.moonloader'
local samp = require('lib.samp.events')
local vkeys = require('vkeys')
local activate = false
function main()
while not isSampAvailable() do wait(100) end
sampAddChatMessage('Запущен', -1)
while true do
wait(0)
if isKeyJustPressed(VK_J) and isKeyCheck() then
activate = true
end
end
end
function samp.onShowDialog(id, style, title, btn1, btn2, text)
if activate then
lua_thread.create(function()
sampSendDialogResponse(id, 1, 0, nil)
wait(200)
sampSendDialogResponce(id, 1, 0, 'text')
wait(200)
sampCloseCurrentDialogWithButton(1)
activate = false
end)
end
end
function isKeyCheck()
if not isSampfuncsLoaded() then
return not isPauseMenuActive()
end
local result = not isSampfuncsConsoleActive() and not isPauseMenuActive()
if isSampLoaded() and isSampAvailable() then
result = result and not sampIsChatInputActive() and not sampIsDialogActive()
end
return result
end