require 'lib.moonloader'
local events = require('lib.samp.events')
local click = false
local exolot = 18875
local use = 2302
local close = 2111
local dialogfix = false
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(80) end
sampRegisterChatCommand('eho', cmd)
while true do
wait(0)
if status and isKeyJustPressed(VK_Q) then
sampSendChat("/invent")
click = true
end
end
end
function events.onShowTextDraw(id, data)
lua_thread.create(function()
wait(200)
if click and data.modelId == exolot or data.text == '…CЊO‡’€O‹AЏ’' or data.text == 'USE' then
sampSendClickTextdraw(id)
wait(200)
sampSendClickTextdraw(use)
wait(100)
sampSendClickTextdraw(close)
click = false
end
end)
end
function cmd()
status = not status
printStyledString(status and '~g~ON' or '~r~OFF',500,4)
end
function events.onShowDialog(dialogId, style, title, button1, button2, text)
if title:find("Подсказка по рыбалке") then
sampSendChat("/mm")
dialogfix = true
return false
end
if dialogId == 722 and dialogfix then
sampSendDialogResponse(722, 0 , 0 , -1)
dialogfix = false
return false
end
end