- 2
- 0
- Версия MoonLoader
- .027.0-preview
code:
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetIO().DisplaySize.x / 2, imgui.GetIO().DisplaySize.y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(537, 450), imgui.Cond.FirstUseEver)
imgui.Begin(u8'Авто-Репорт', tableOfNew.AutoReport, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse)
imgui.BeginChild('##i_report', imgui.ImVec2(520, 30), true)
if #reports > 0 then
imgui.PushTextWrapPos(500)
imgui.TextUnformatted(u8(reports[1].nickname..'['..reports[1].id..']: '..reports[1].textP))
imgui.PopTextWrapPos()
end
imgui.EndChild()
imgui.Separator()
imgui.PushItemWidth(520)
imgui.InputText(u8'##answer_input_report', tableOfNew.answer_report)
imgui.PopItemWidth()
imgui.Text(u8' Введите ответ')
imgui.Separator()
if imgui.Button(u8'Работать по ID', imgui.ImVec2(100, 0)) then
if #reports > 0 then
if reports[1].textP:find('%d+') then
tableOfNew.AutoReport.v = false
imgui.ShowCursor = false
lua_thread.create(function()
local id = reports[1].textP:match('(%d+)')
sampSendChat('/pm '..reports[1].id..' Уважаемый игрок, начинаю работу по вашей жалобе!')
wait(1000)
sampSendChat('/re '..id)
refresh_current_report()
end)
еще code:
if text:find('Репорт от (.*)%[(%d+)%]: %{FFCD00%}(.*)') then
local Rnickname, Rid, RtextP = text:match('Репорт от (.*)%[(%d+)%]: %{FFCD00%}(.*)')
reports[#reports + 1] = {nickname = Rnickname, id = Rid, textP = RtextP}
end
if #reports > 0 then
if color == -6732289 then
for k, v in pairs(reports) do
if k == 1 then
if not tableOfNew.AutoReport.v then
if text:find('%[.%] (.*)%[(%d+)%] для '..reports[1].nickname..'%['..reports[1].id..'%]: (.*)') then
refresh_current_report()
end
end
elseif #reports > 1 then
if text:find('%[.%] (.*)%[(%d+)%] для '..reports[k].nickname..'%['..reports[k].id..'%]: (.*)') then
table.remove(reports, k)
end
end
end
end
end
if elements.checkbox.enableAutoReport.v then
if text:find('Репорт от (.*)%[(%d+)%]: %{FFCD00%}'..u8:decode(elements.input.textFindAutoReport.v)) then
if elements.input.textFindAutoReport.v ~= '' and elements.input.answerAutoReport.v ~= '' then
local nickRep, idRep = text:match('Репорт от (%w+_?%w+)%[(%d+)%]: %{FFCD00%}'..u8:decode(elements.input.textFindAutoReport.v))
answer_flets[#answer_flets + 1] = ('/pm '..idRep..' '..u8:decode(elements.input.answerAutoReport.v))
else
sampAddChatMessage('{FF0000}[Ошибка] {FF8C00}Вы не указали ответ/поисковой текст в авто-ответчике', stColor)
end
не вижу смысла кидать фул код админтулса,но мне нужно что бы находило репорт от игроков,щас прикреплю чатлог
[17:34:32] Репорт от Kool_Aura[191]: {FFFFFF}Инвайты в гетто открыты?
[17:34:33] Репорт от Kristina_Demon[286]: {FFFFFF}прошу сп
Последнее редактирование: