local enabled = false
local sampev = require "lib.samp.events"
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("aans", function()
enabled = not enabled
sampAddChatMessage("Auto answer "..(enabled and "enabled" or "disabled"), -1)
end)
wait(-1)
end
function sampev.onShowDialog(id, style, title, button1, button0, text)
if enabled then
if id == ТУТ_ID and title:find("Покупка транспорта") then
lua_thread.create(function() wait(10)
sampSendDialogResponse(id, 1, 2, nil)
end)
elseif id == ТУТ_ID and title:find("Подтверждение покупки") then
lua_thread.create(function() wait(10)
sampSendDialogResponse(id, 1, nil, nil)
end)
end
end
end