[Arizona-RP] Помощь со скриптом.

niko.mirage

Новичок
Автор темы
6
0
Приветствую,
Есть у меня КОД Скрипта для автоматической ловли репорта на Проекте Arizona RP но не работает тут деактивация скрипта когда словил репорт. Может ли кто-то помочь нужно что бы работало так: Когда скрипт словил репорт - отключается до следующего включения.

AutoReport:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetCurrentDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end
 

romanespit

Участник
19
7
Попробуй
Lua:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false
local thread = lua_thread.create(function() return end)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() and thread:status() == "dead" then
            thread = lua_thread.create(function ()
                sampSendChat('/ot')
                wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
            end)
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetCurrentDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end
 

niko.mirage

Новичок
Автор темы
6
0
Попробуй
Lua:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false
local thread = lua_thread.create(function() return end)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() and thread:status() == "dead" then
            thread = lua_thread.create(function ()
                sampSendChat('/ot')
                wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
            end)
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetCurrentDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end
теперь скрипт не работает вообще точнее не отключается даже на клавишу F3 тот который я кинул код там можно было отключить скрипт на f3 теперь и этого нельзя
 

SAKUTA

Участник
96
26
попробуй

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150)
        end

        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        if sampIsDialogActive() then
            local success, dialogText = pcall(sampGetCurrentDialogText)
            if success and dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end

require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end

while true do
wait(0)
if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
active = not active
printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
end

-- Флуд командой /ot, пока активно и нет окна репорта
if active and not sampIsDialogActive() then
sampSendChat('/ot')
wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
end

-- Отключение автоответа при появлении окна репорта
if sampIsDialogActive() and active then
active = false
printString('AutoReport: ~r~disabled due to active report dialog', 1500)
end

-- Отключение автоответа при получении успешного ответа на репорт
if sampIsDialogActive() then
local dialogText = sampGetDialogText()
if dialogText and dialogText:find("Ваш репорт принят") then
active = false
printString('AutoReport: ~r~disabled due to successful report submission', 1500)
end
end
end
end
 
Последнее редактирование:

niko.mirage

Новичок
Автор темы
6
0
попробуй

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150)
        end

        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        if sampIsDialogActive() then
            local success, dialogText = pcall(sampGetCurrentDialogText)
            if success and dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end
можно выключить на f3 но скрипт сам не выключается когда словил репорт почему-то
 

SAKUTA

Участник
96
26
cори, ток увидел что ты не правильно функцию использавал, в сампе нету такой функции как "sampGetCurrentDialogText()", это "sampGetDialogText"

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end

можно выключить на f3 но скрипт сам не выключается когда словил репорт почему-то
не понял?
upd: понял, из за функции pcall, там не верная функция была, щас попробуй который последний скинул
 

niko.mirage

Новичок
Автор темы
6
0
cори, ток увидел что ты не правильно функцию использавал, в сампе нету такой функции как "sampGetCurrentDialogText()", это "sampGetDialogText"

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end


не понял?
upd: понял, из за функции pcall, там не верная функция была, щас попробуй который последний скинул
Не выключает ничего, можно это из за того что в чат не пишет ничего когда словил я репорт а просо диалог открывает
 

SAKUTA

Участник
96
26
Не выключает ничего, можно это из за того что в чат не пишет ничего когда словил я репорт а просо диалог открывает
хм, ща

убрал доп проверку которая нахуй не нужна, теперь если есть какой то диалог - он будет считать что ты словил диалог

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end
    end
end

если по прежнему не работает, скинь айди диалога ответа на репорт, сделаю проверку по айди диалога
 
Последнее редактирование:

niko.mirage

Новичок
Автор темы
6
0
cори, ток увидел что ты не правильно функцию использавал, в сампе нету такой функции как "sampGetCurrentDialogText()", это "sampGetDialogText"

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end

        -- Отключение автоответа при получении успешного ответа на репорт
        if sampIsDialogActive() then
            local dialogText = sampGetDialogText()
            if dialogText and dialogText:find("Ваш репорт принят") then
                active = false
                printString('AutoReport: ~r~disabled due to successful report submission', 1500)
            end
        end
    end
end


не понял?
upd: понял, из за функции pcall, там не верная функция была, щас попробуй который последний скинул
можно связь с тобой в ТГ что бы тут не флудить ?

хм, ща

убрал доп проверку которая нахуй не нужна, теперь если есть какой то диалог - он будет считать что ты словил диалог

Код:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'

local active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    while true do
        wait(0)
        if isKeyJustPressed(0x72) and not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() then
            active = not active
            printString('AutoReport: '..(active and '~g~activated' or '~r~disabled'), 1500)
        end

        -- Флуд командой /ot, пока активно и нет окна репорта
        if active and not sampIsDialogActive() then
            sampSendChat('/ot')
            wait(150) -- интервал в 150 мс, чтобы не перегружать сервер
        end

        -- Отключение автоответа при появлении окна репорта
        if sampIsDialogActive() and active then
            active = false
            printString('AutoReport: ~r~disabled due to active report dialog', 1500)
        end
    end
end

если по прежнему не работает, скинь айди диалога ответа на репорт, сделаю проверку по айди диалога
Ответ на репорт выглядит так:
Так как это тулс 13GG
1740773991151.png



Как тут узнать ID диалога тяжело, скачал скрипт какой-то который показывает ID диалога то тут ничего он не показывает а другие диалоги показывает
 
Последнее редактирование:

SAKUTA

Участник
96
26
можно связь с тобой в ТГ что бы тут не флудить ?


Ответ на репорт выглядит так:
Так как это тулс 13GG
Посмотреть вложение 264615


Как тут узнать ID диалога тяжело, скачал скрипт какой-то который показывает ID диалога то тут ничего он не показывает а другие диалоги показывает
а бля, это цеф, на мой тг @ne_sakuta

а бля, это цеф, на мой тг @ne_sakuta
прошу прощение, это не цеф а имгуи 👉👈