local samp = require('samp.events')
local active = true
function main()
repeat wait(0) until isSampAvailable()
while true do
wait(0)
if isKeyJustPressed(78) then
active = not active
printStringNow(active and '~g~Enabled' or '~r~Disabled', 1000)
setVirtualKeyDown(18, false)
end
end
end
function samp.onShowDialog(id, style, title, button1, button2, text)
if text:find('{FFFFFF}1%.%sСигареты%s+{6BF85E}250%${FFFFFF}') and active then
sampSendDialogResponse(id, 1, 2, nil)
lua_thread.create(function()
while active do
wait(0)
setVirtualKeyDown(18, true)
wait(1000)
setVirtualKeyDown(18, false)
end
end)
end
end