> For the complete documentation index, see [llms.txt](https://docs.brutalscripts.com/site/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brutalscripts.com/site/scripts/reports/accessible-files.md).

# Accessible files

<details>

<summary>config.lua</summary>

```lua
----------------------------------------------------------------------------------------------
------------------------------------| BRUTAL REPORTS :) |-------------------------------------
----------------------------------------------------------------------------------------------

--[[

Hi, thank you for buying our script, We are very grateful!

For help join our Discord server:     https://discord.gg/85u2u5c8q9
More informations about the script:   https://docs.brutalscripts.com

--]]

Config = {
    Core = 'ESX',  -- ESX / QBCORE / STANDALONE  | Other core setting on the 'core' folder and the client and server utils.lua
    ReportMenu = {Command = 'report', CommandLabel = 'Use the command to open the Report Menu'},
    AdminMenu = {Command = 'reports', CommandLabel = 'Use the command to open the Report List'},
    AdminNotify = {Command = 'an', CommandLabel = 'Use the command to switch off/on the report admin notifys'},

    PlayerLoadedTime = 5000, -- in ms | 1000 = 1 sec (Only if the Core = STANDALONE)
    
    AdminGroups = {'superadmin', 'admin', 'mod'},  -- Only if the Core = ESX / QBCORE
    IdentifierPermission = false,  -- If Core = STANDALONE then this is in use

    Admins = {
        'discord:806082985861447691',
        'discord:692782027866636308',

        --[[ TYPES ]]--
        -- 'steam:123456789',
        -- 'license:123456789',
        -- 'fivem:123456789',
        -- 'ip:123456789',
        -- 'discord:123456789',
    },

    --[[ Add your Webhook in >> server-utils.lua ]]--
    Webhooks = {
        Locale = {
            ['NewReport'] = 'New Report',
            ['ClosedReport'] = 'Closed Report',

            ['Category'] = 'Category',
            ['Title'] = 'Title',
            ['Description'] = 'Description',
            ['Playerdetails'] = 'Player details',
            ['Admindetails'] = 'Admin details',
            ['ID'] = 'ID',
            ['Name'] = 'Name',
            ['Identifier'] = 'Identifier',
            ['Discord'] = 'Discord',

            ['Time'] = 'Time ⏲️'
        },
        -- To change a webhook color you need to set the decimal value of a color, you can use this website to do that - https://www.mathsisfun.com/hexadecimal-decimal-colors.html
        Colors = {
            ['newReport'] = 16776960, 
            ['closeReport'] = 16711680
        }
    },

    -----------------------------------------------------------
    -----------------------| TRANSLATE |-----------------------
    -----------------------------------------------------------

    NoneAdmin = 'None',
    Report = 'Report #',

    Notify = {
        [1] =  {'Brutal Reports', "An admin send you a Message!", 5000, 'info'},
        [2] =  {'Brutal Reports', "You don't have permission to use the Command!", 5000, 'error'},
        [3] =  {'Brutal Reports', "Your report has been closed!", 5000, 'info'},
        [4] =  {'Brutal Reports', "You have got freeze!", 5000, 'info'},
        [5] =  {'Brutal Reports', "You have got unfreeze!", 5000, 'info'},
        [6] =  {'Brutal Reports', "You have got revive!", 5000, 'info'},
        [7] =  {'Brutal Reports', "A new report has arrived!", 5000, 'info'},
        [8] =  {'Brutal Reports', "Has been closed!", 5000, 'info'},
        [9] =  {'Brutal Reports', "Admin Notify: OFF", 5000, 'info'},
        [10] = {'Brutal Reports', "Admin Notify: ON", 5000, 'info'},
        [11] = {'Brutal Reports', "The title is too long,<br>Maximum 25 character!", 5000, 'error'},
        [12] = {'Brutal Reports', "Please fill all the spaces!", 5000, 'error'},
        [13] = {'Brutal Reports', "You can't open your own report!", 5000, 'error'},
    }
}
```

</details>

<details>

<summary>client-utils.lua</summary>

```lua
if Config.Core:upper() == 'ESX' then
    LoadedEvent = 'esx:playerLoaded'
    ReviveEvent = 'esx_ambulancejob:revive'
elseif Config.Core:upper() == 'QBCORE' then
    LoadedEvent = 'QBCore:Client:OnPlayerLoaded'
    ReviveEvent = 'hospital:client:Revive'
end

-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(title, text, time, type)
    exports['brutal_notify']:SendAlert(title, text, time, type)

    --SetNotificationTextEntry("STRING")
    --AddTextComponentString(text)
    --DrawNotification(0,1)

    -- Default ESX Notify:
    --TriggerEvent('esx:showNotification', text)

    -- Default QB Notify:
    --TriggerEvent('QBCore:Notify', text, 'info', 5000)
end
```

</details>

<details>

<summary>server-utils.lua</summary>

```lua
local YourWebhook = 'WEBHOOK-HERE'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

---------------------------------------------------

if Config.Core:upper() == 'ESX' then
    Core = exports['es_extended']:getSharedObject()
elseif Config.Core:upper() == 'QBCORE' then
    Core = exports['qb-core']:GetCoreObject()
end

function PlayerName(source)
    return GetPlayerName(source)
end

function StaffCheck(source)
    local staff = false

    if Config.Core:upper() == 'ESX' and Config.IdentifierPermission ~= true then
        local player = Core.GetPlayerFromId(source)
        local playerGroup = player.getGroup()

        for i, Group in ipairs(Config.AdminGroups) do
            if playerGroup == Group then
                staff = true
                break
            end
        end
    elseif Config.Core:upper() == 'QBCORE' and Config.IdentifierPermission ~= true then
            local player = Core.Functions.GetPlayer(source)
    
            for i, Group in ipairs(Config.AdminGroups) do
                if Core.Functions.HasPermission(source, Group) then
                    staff = true
                    break
                end
            end
    elseif Config.IdentifierPermission or Config.Core:upper() == 'STANDALONE' then
        for i, a in ipairs(Config.Admins) do
            for x, b in ipairs(GetPlayerIdentifiers(source)) do
                if string.lower(b) == string.lower(a) then
                    staff = true
                    break
                end
            end
        end
    end

    return staff
end

function GetIdentifier(source)
    local identifiers = {}
    for i = 0, GetNumPlayerIdentifiers(source) - 1 do
        local id = GetPlayerIdentifier(source, i)
        if string.find(id, "steam") then
            identifiers.steam = id
        elseif string.find(id, "discord") then
            identifiers.discord = id
        elseif string.find(id, "license") then
            identifiers.license = id
        end
    end


    if Config.Core:upper() == 'ESX' then
        identifier = Core.GetPlayerFromId(source).identifier
    elseif Config.Core:upper() == 'QBCORE' then
        identifier = Core.Functions.GetPlayer(source).PlayerData.citizenid
    else
        identifier = identifiers.steam
    end

    if identifier == nil then
        identifier = "-"
    end
    return identifier
end
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brutalscripts.com/site/scripts/reports/accessible-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
