script_authors("TG @Qwestonsz")
script_url("https://www.blast.hk/members/464512/")
local sampev = require("samp.events")
local active = false
local houseIndex = 0
local houseCount = 0
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage('Скрипт [{FF00FF}'..thisScript().filename..'{FFFFFF}] загружен Автор [{FF00FF}'..unpack(thisScript().authors)..'{FFFFFF}] Активация {FF00FF}/geth', -1)
sampRegisterChatCommand('geth', function()
active = true
houseIndex = 0
sampSendChat("/flashminer")
end)
wait(-1)
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if title:find('Выбор дома') and active then
local lines = {}
for line in text:gmatch("[^\r\n]+") do
table.insert(lines, line)
end
houseCount = #lines - 1
if houseCount > 0 then
sampSendDialogResponse(dialogId, 1, houseIndex, "")
houseIndex = houseIndex + 1
if houseIndex >= houseCount then
houseIndex = 0
active = false
sampAddChatMessage('Все дома выбраны (' .. houseCount .. '), начинаем сначала.', -1)
end
else
sampAddChatMessage('Ошибка: дома не найдены в диалоге.', -1)
active = false
end
return false
end
return true
end