if CurQuest:find('?') then
CurQuest = text:match('Вопрос:%s+(.*)?')
else
CurQuest = text:match('Вопрос:%s+(.*)%s+Введите')
end
end
if CurQuest then
sampAddChatMessage(tag..' Вопрос: '..CurQuest, -1)
CurQuest = CurQuest:gsub('%%', '')
CurQuest = CurQuest:gsub(' ', '')
CurQuest = CurQuest:gsub(',', '')
CurQuest = CurQuest:gsub('-', '')
CurQuest = CurQuest:gsub(' ', '')
for i = 1, #questions do
textik = questions[i]
if textik ~= nil then
question, answer = textik:match("{q = '(.*)', a = '(.*)'}")
if question ~= nil then
question = question:gsub('%%', '')
question = question:gsub(' ', '')
question = question:gsub(',', '')
question = question:gsub('-', '')
question = question:gsub(' ', '')
if CurQuest:find(question) then
sampSendDialogResponse(id, 1, 0, answer)
sampAddChatMessage(tag..' Ответил: '..answer, -1)
Answered = true
WaitingAnswer = false
sampCloseCurrentDialogWithButton(0)
return false
end
end
end
end