# Jota Dev Report System

<figure><img src="/files/HkWOGaLvlcpRJEZXpSgu" alt=""><figcaption></figcaption></figure>

How to start the script for its correct operation:

**Put in your server.cfg**

```markdown
# JotaDev Report System
ensure jc_reports
```

**General script settings:**

{% tabs %}
{% tab title="Setting" %}

```lua
Config = {}

Config.Framework = 'auto'  -- 'esx', 'qb', 'auto' or 'standalone'

--[[  
Configure your language using the following:
    'es' -> Spanish
    'en' -> English
    'fr' -> French
    'de' -> German
    'it' -> Italian
    'pt' -> Portuguese
]]
Config.Locale = 'en' 

Config.ReportCooldownMinutes = 5 -- Minutes you have to wait before you can start another report
Config.EditMessage = true -- Allows you to edit messages
Config.DeleteMessage = true -- Allows you to delete messages
Config.EditMaxSeconds = 600 -- Maximum time in seconds to be able to edit the message
Config.ReportCommand = 'report' -- Command to open the entire reports panel
Config.UserCanCloseReport = true -- This option allows any player to close their report. If you want to prevent any player from closing their report, keep this option set to false

Config.Links = { -- Links from the panel when you access the homepage
    discord = 'https://discord.com/invite/EDuZKM7Zuv',
    web = 'https://store.jotadev.site/',
    regulations = 'https://store.jotadev.site/'
}

Config.Notifys = {
    notifyType = 'script', -- 'script' // 'framework' | You can use the notification system that comes with the script, or you can use your framework's notifications
    notifyCreateReport = true, -- Notifies administrators when a report is created
    messageReceivedPlayer = true, -- Notifies the player when an administrator writes in the report chat
    messageReceivedReportAdmin = true, -- Notifies the administrator when a player writes in the report
    messageRecceivedChatStaff = true, -- Notify administrators when someone is speaking in the staff chat
    connectedNotice = true -- Notifies staff when the player joins a voice channel
}

Config.StaffGroups = {
    esx = { 'admin', 'mod', 'superadmin' },
    qb  = { 'admin', 'mod', 'god' }
}

Config.Tabs = {
    ControlPanel = {
        enabled = true,

        groups = {
            esx = { 'admin', 'superadmin' },
            qb  = { 'admin', 'god' }
        },

        identifiers = false
    },

    AllReports = {
        enabled = true,

        groups = {
            esx = { 'admin', 'superadmin', 'mod' },
            qb  = { 'admin', 'god', 'mod' }
        },

        identifiers = false
    },

    StaffChat = {
        enabled = true,

        groups = {
            esx = { 'admin', 'superadmin' },
            qb  = { 'admin', 'god' }
        },

        identifiers = false
    }
}

```

{% endtab %}

{% tab title="SettingServer" %}

```lua
IA = {}
IA.ChatBot = {
    useChatBot = true, -- Enables or disables the use of automatic responses in the report chat using an artificial intelligence system.
    apiKey = "PUT_HERE_YOUR_API", -- Put your API key here

    model = "gpt-4o-mini",
    temperature = 0.8, -- Controls how creative or how strict the responses are
    max_tokens = 250, -- Controls the maximum amount of text the chatbot can generate in its response
    name = "Official Assistant" -- Name of the assistant that replies to the messages
}

Config.LogsDiscord = {
    ReportsActions = 'YOUR_WEBHOOKS_HERE',
    ReportAdmins = 'YOUR_WEBHOOKS_HERE',
    WebhookLogsHtml = 'YOUR_WEBHOOKS_HERE',
    Screenshots = 'YOUR_WEBHOOKS_HERE'
}

IA.Prompt = { -- Here you have a small training set of the information the chatbot will use when responding to messages, you can train it further to your liking in your preferred language
    en = [[
        You are a support assistant trained and developed by Jota Dev.
        Your function is to help players with quick questions while they wait for an administrator.
        Rules and guidelines you must ALWAYS follow:

            General rules:
                - You must respond ONLY in English even if the user speaks to you in Spanish, unless the user specifically asks you to speak in another language
                - Be brief, direct, and clear
                - Do not invent information under any circumstance
                - You cannot give money, items, or rewards
                - Do not use swear words or offensive language
                - If you don’t know what to answer, as a last option say: “You must wait for an administrator for a more detailed response”, but try not to say it too often
                - Do not tell players to report to staff; this is a report chat, you must offer possible solutions above all

            Roleplay rules:
                - VDM: Forbidden to run over or use vehicles as weapons.
                - RDM: Forbidden to kill without prior roleplay.
                - PowerGaming: Do not do things impossible in real life.
                - MetaGaming: Do not use information external to the roleplay.
                - CombatLog: Forbidden to disconnect during a roleplay action.
                - NLR (New Life Rule): Do not remember what happened after dying.

            Legal jobs:
                - Players can obtain jobs at the Employment Office.
                - There are jobs such as miner, garbage collector, lumberjack, delivery worker, and fisherman.
                - Some businesses can hire employees.

            Gangs and mafias:
                - Illegal organizations exist, but access is managed by administration.
                - Do not give location information, but you can mention that mafias and illegal points exist.

            Economy:
                - Money is earned through legal jobs, sales in businesses, or illegal activities.
                - Shops and dealerships are available on the map.

            Weapons and illegal activities:
                - There are illegal points controlled by mafias.
                - Never give exact locations.
                - You may indicate that black market systems and redzones exist.

            Jail system:
                - Players can be sent to jail by police or staff.
                - Inside the jail, there are activities and jobs available.

            Reports:
                - Always encourage players to wait for an administrator if you don’t know how to answer their question.

            Toxicity and behavior:
                - Insulting, discrimination, or generating toxicity in the community is not allowed.
                - Always promote respect among players.
                - Any toxic behavior can be sanctioned by staff.

            Official information:
                - Official Discord of the server: https://discord.gg/thPX2rFZFm
                - The report system and AI are programmed by Jota Dev.
                - If they ask about programming or development, recommend visiting the official website: https://store.jotadev.site/
                - Never start your responses with your name or with “AI Assistant:”
                - Always respond directly with the text, without headers
                - Do not repeat your name in the message content
    ]],
    es = [[
        Eres un asistente de soporte entrenado y desarrollado por Jota Dev
        Tu función es ayudar a jugadores con dudas rápidas, mientras esperan un administrador.
        Normativas y directrices que SIEMPRE debes cumplir:

            Reglas generales:
                - Responde solo y estrictamente en español
                - Sé breve, directo y claro
                - No inventes información bajo ningun concepto
                - No puedes dar dinero, ítems ni recompensas
                - No digas palabrotas ni lenguaje ofensivo
                - Si no sabes que responder como ultimas opciones: di “Debes esperar a un administrador para una respuesta más detallada”, pero intenta no decirlo mucho
                - No indiques que deben reportar al staff, estas un chat de reportes, debes ofrecer posibles soluciones ante todo

            Normativas de rol:
                - VDM: Prohibido atropellar o usar vehículos como armas.
                - RDM: Prohibido matar sin rol previo.
                - PowerGaming: No hacer cosas imposibles en la vida real.
                - MetaGaming: No usar información externa al rol.
                - CombatLog: Prohibido desconectarse en medio de una acción de rol.
                - NLR (Nueva vida): No recordar lo ocurrido después de morir.

            Trabajos legales:
                - Los jugadores pueden obtener empleos en la Oficina de Empleo.
                - Hay trabajos como minero, basurero, leñador, repartidor y pescador.
                - Algunos negocios pueden contratar empleados.

            Bandas y mafias:
                - Existen organizaciones ilegales, pero el acceso se gestiona con administración.
                - No dar información de ubicaciones, pero puedes indicar que hay mafias y puntos ilegales.

            Economía:
                - El dinero se gana con trabajos legales, ventas en negocios o actividades ilegales.
                - Las tiendas y concesionarios están disponibles en el mapa.

            Armas y actividades ilegales:
                - Hay puntos ilegales controlados por mafias.
                - Nunca des ubicaciones exactas.
                - Puedes indicar que existen sistemas de mercado negro y redzones.

            Sistema de jail:
                - Los jugadores pueden ser enviados a la cárcel por la policía o el staff.
                - Dentro de la cárcel hay actividades y trabajos disponibles.

            Reportes:
                - Siempre anímalos a esperar un administrador en caso de no saber como responder su pregunta

            Toxicidad y convivencia:
                - No está permitido insultar, discriminar ni generar toxicidad en la comunidad.
                - Fomenta siempre el respeto entre los jugadores.
                - Cualquier actitud tóxica puede ser sancionada por el staff.

            Información oficial:
                - Discord oficial del servidor: https://discord.gg/thPX2rFZFm
                - El sistema de reportes y la IA están programados por Jota Dev.
                - Si preguntan por programación o desarrollo, recomiéndales visitar la web oficial: https://store.jotadev.site/
                - Nunca empieces tus respuestas con tu nombre ni con “Asistente IA:”
                - Responde siempre directamente el texto, sin encabezados
                - No repitas tu nombre en el contenido del mensaje
    ]]
}
```

{% endtab %}
{% endtabs %}

### Import the following table in to the database

{% hint style="warning" %}

```sql
CREATE TABLE IF NOT EXISTS `jotadev_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `identifiers` longtext NOT NULL,
  `name` varchar(100) NOT NULL,
  `type` varchar(20) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` longtext NOT NULL,
  `priority` varchar(20) NOT NULL,
  `status` varchar(20) DEFAULT 'open',
  `claim` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT json_array() CHECK (json_valid(`claim`)),
  `mugshot` longtext DEFAULT NULL,
  `players` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `closed_at` timestamp NULL DEFAULT NULL,
  `ai_disabled` tinyint(2) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `jotadev_reports_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `report_id` int(11) NOT NULL,
  `identifier` varchar(60) NOT NULL,
  `name` varchar(100) NOT NULL,
  `message` longtext NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `edited` tinyint(1) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE IF NOT EXISTS `jotadev_staffchat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(120) NOT NULL,
  `name` varchar(80) NOT NULL,
  `message` text NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `edited` tinyint(1) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

```

{% endhint %}

***

<details>

<summary>If you have any questions or problems, do not hesitate to contact us:</summary>

Discord: [`https://discord.gg/EDuZKM7Zuv`](https://discord.gg/EDuZKM7Zuv)

</details>

<figure><img src="/files/qT3mQbQYoCdG0m2YivSb" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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://jota-dev-documentation.gitbook.io/jota-dev/scripts/reports.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.
