📝Configurables

In this page, you can see everything that can be configured/changed within this script.

Config files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config = {}

Config.Locale = 'en'
Config.SaveInterval = 5 -- Minutes to save reports to database
Config.ToggleNotifications = true -- Allow toggling of report notifications like new opened, chat of claimed tickets (default = disabled)
Config.MaxReports = 5 -- Max reports a player can have open at once
Config.HideAdminName = false -- Hide admin name for players in their reports (chat, claimed & closed by etc)

Config.Categories = {
    {
        name = 'Report Player',
        fields = {
            { label = 'ID of Reported Player', type = 'number', cols = 6, required = false, isReportedId = true },
            { label = 'Subject', type = 'text', cols = 6, required = true },
            { label = 'Detailed Report', type = 'textarea', cols = 12, required = true },
        },
    },
    {
        name = 'Report Bug',
        fields = {
            { label = 'Subject', type = 'text', cols = 12, required = true },
            { label = 'Detailed Report', type = 'textarea', cols = 12, required = true },
        },
    },
    {
        name = 'Report Other',
        fields = {
            { label = 'Subject', type = 'text', cols = 12, required = true },
            { label = 'Detailed Report', type = 'textarea', cols = 12, required = true },
        },
    },
}

Config.StaffActions = { -- For each action, a function needs to be made in config/sv_config.lua: Config.ActionsFunctions
    {
        name = 'heal',
        label = 'Heal',
        severity = 'success', -- Possibilities: 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'contrast'
        toReporter = true, -- Enable action to execute on the reporter
        toReported = false, -- Enable action to execute on the reported player (in case there is any)
    },
    {
        name = 'spectate',
        label = 'Spectate',
        severity = 'info',
        toReporter = true, -- Enable action to execute on the reporter
        toReported = true, -- Enable action to execute on the reported player (in case there is any)
    },
    {
        name = 'goto',
        label = 'Go To',
        severity = 'info',
        toReporter = true, -- Enable action to execute on the reporter
        toReported = true, -- Enable action to execute on the reported player (in case there is any)
    },
    {
        name = 'bring',
        label = 'Bring',
        severity = 'info',
        toReporter = true, -- Enable action to execute on the reporter
        toReported = true, -- Enable action to execute on the reported player (in case there is any)
    },
    {
        name = 'tpback',
        label = 'TP Back',
        severity = 'info',
        toReporter = true, -- Enable action to execute on the reporter
        toReported = true, -- Enable action to execute on the reported player (in case there is any)
    },
    {
        name = 'customExample',
        label = 'Create Custom Action',
        severity = 'contrast',
        toReporter = true, -- Enable action to execute on the reporter
        toReported = true, -- Enable action to execute on the reported player (in case there is any)
    }
}

Config.Priorities = {
    {
        name = 'Low',
        severity = 'info', -- Possibilities: 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'contrast'
        playerAllowed = true, -- Allow players to set this priority themselves upon creating a report
    },
    {
        name = 'Medium',
        severity = 'warn',
        playerAllowed = true,
    },
    {
        name = 'High',
        severity = 'danger',
        playerAllowed = false,
    }
}

Config.QuickResponses = {
    {
        label = 'More Info',
        text = 'We have reviewed your report, and decided we need more information in order to work on this matter. Please respond with extra information.'
    },
}

Config.BlacklistedWords = { -- Reports cannot include any of these words
    'fuck',
}

Config.Commands = {
    reportPanel = 'report', -- /report | Report a player, bug or other, and see your reports
    staffPanel = 'reports', -- /reports | Open the reports staff panel
    toggleNotifications = 'reportnotify', -- /reportnotify | Toggle incoming report notifications
}

Config.Keybinds = {
    reportPanel = 'F6', -- Opens Report Panel
    staffPanel = 'F7', -- Opens Reports Staff Panel
}

--[[
    YOU CAN USE ACE PERMISSIONS TO ALLOW CERTAIN PLAYERS/GROUPS TO ACCESS THE REPORTS PANEL
    EXAMPLE:
        add_ace group.admin reports allow
        add_ace identifier.fivem:1432744 reports allow #Rejox

    OR YOU CAN USE THE STAFF GROUPS BELOW
--]]
Config.StaffGroups = {
    'superadmin',
    'admin',
    'god',
    'mod',
}

--[[
    ONLY CHANGE THIS PART IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
---@type table Only change these if you have changed the name of a resource
Resources = {
    FM = { name = 'fmLib', export = 'new' },
    SCREENBASIC = { name = 'screenshot-basic', export = 'all' },
}
IgnoreScriptFoundLogs = false

Opensource files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

RegisterNetEvent('rxreports:healPlayer', function()
    local playerPed = PlayerPedId()
    local coords = GetEntityCoords(playerPed)
    local heading = GetEntityHeading(playerPed)

    NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
    ClearPedBloodDamage(playerPed)
    ClearPedTasksImmediately(playerPed)
    SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed))
    SetPlayerSprint(PlayerId(), true)
    ResetPedMovementClipset(playerPed, 0.0)
end)

RegisterNetEvent('rxreports:spectatePlayer', function(spectateId)
    -- One of these is correct depending on your txAdmin version
    TriggerServerEvent('txsv:req:spectate:start', spectateId)
    TriggerServerEvent('txAdmin:menu:spectatePlayer', spectateId)
end)

Last updated