local samp = require('samp.events')
local active = false
function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand('dep', function(int)
active = not active
printStringNow('Autodeposit ' .. (active and '~g~enabled' or ('~r~disabled')), 1500)
local v = int:match('%d+')
if active and v then
summ = v
else
active = false
sampAddChatMessage('{f7e89c}Ты не ввёл сумму', -1)
printStringNow('~r~ERROR', 1500)
end
end)
end
function samp.onShowDialog(id, style, title, button1, button2, text)
if active and title:find('Банк') and text:match('Состояние%sосновного%sсчета') then
sampSendDialogResponse(id, 1, 18, nil)
end
if active and title:find('Введите сумму') and text:find('для пополнения депозита') then
sampSendDialogResponse(id, 1, nil, summ)
end
end