-- надеюсь ты это искал
local sampev = require("lib.samp.events")
lastdialog = {}
function main()
repeat wait(100) until isSampAvailable()
while true do
wait(0)
if sampIsDialogActive() and lastdialog.id == 245 and isKeyDown(VK_MENU) then
local count = -1
for line in lastdialog.text:gmatch('[^\r\n]+') do
count = count + 1
if line:find('Desert Eagle') then
wait(300)
sampSendDialogResponse(lastdialog.id, 1, count, -1)
break
end
end
end
end
end
function sampev.onShowDialog(dialogid, style, title, btn1, btn2, text)
lastdialog.id = dialogid
lastdialog.style = style
lastdialog.title = title
lastdialog.btn1 = btn1
lastdialog.btn2 = btn2
lastdialog.text = text
end