Installation · origen_reports
1. Database
The resource ships with an auto-migrator. On every start it reads database.sql from the resource root, creates any missing table and adds or updates missing columns, so no manual SQL import is required.
If you prefer to create the schema manually, run the following SQL before starting the resource:
CREATE TABLE `origen_reports_tickets` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`reporter_identifier` VARCHAR(100) NOT NULL,
`reporter_name` VARCHAR(100) NOT NULL,
`identifiers` LONGTEXT NOT NULL,
`type` VARCHAR(100) NOT NULL,
`description` TEXT NOT NULL,
`status` ENUM('pending','claimed','resolved') NOT NULL DEFAULT 'pending',
`assigned_name` VARCHAR(100) DEFAULT NULL,
`assigned_identifier` VARCHAR(100) DEFAULT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
INDEX `idx_reporter` (`reporter_identifier`),
INDEX `idx_status` (`status`),
INDEX `idx_assigned_identifier` (`assigned_identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_messages` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`report_id` INT UNSIGNED NOT NULL,
`sender` VARCHAR(100) NOT NULL,
`text` TEXT NOT NULL,
`is_staff` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
INDEX `idx_report` (`report_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_types` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`label` VARCHAR(100) NOT NULL,
`icon` VARCHAR(50) NOT NULL DEFAULT 'help',
`sort_order` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_teleports` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`coords` LONGTEXT NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_config` (
`key` VARCHAR(100) NOT NULL,
`value` LONGTEXT NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_groups` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`permissions` LONGTEXT NOT NULL,
`allow_all_items` TINYINT(1) NOT NULL DEFAULT 1,
`allowed_items` LONGTEXT DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `origen_reports_staff` (
`identifier` VARCHAR(100) NOT NULL,
`name` VARCHAR(100) NOT NULL,
`group_id` INT UNSIGNED DEFAULT NULL,
`total_resolved` INT UNSIGNED NOT NULL DEFAULT 0,
`total_duty_seconds` INT UNSIGNED NOT NULL DEFAULT 0,
`last_seen` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`identifier`),
CONSTRAINT `fk_staff_group` FOREIGN KEY (`group_id`) REFERENCES `origen_reports_groups` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;origen_reports_groups must exist before origen_reports_staff because of the fk_staff_group foreign key. Keep the order above if you import the file by hand.
2. server.cfg
Add the resource after its dependencies:
ensure ox_lib
ensure oxmysql
ensure screenshot-basic # optional, only for the screenshot quick action
ensure origen_reportsThe framework, inventory, clothing and ambulance resources must also be started before origen_reports so the auto-detection finds them.
3. Staff access
A player becomes staff through one of three access levels:
| Level | How it is granted | Permissions |
|---|---|---|
| Full | Any permission listed in Config.StaffFullAccess | Every quick action and the whole admin panel |
| Limited | Added as staff from the admin panel with a group assigned | Exactly the permissions of that group |
| Basic | Any permission listed in Config.StaffBasicAccess | Default basic set (see below) |
Each entry of Config.StaffFullAccess / Config.StaffBasicAccess is checked, in order, against:
- The ACE
<permission>orgroup.<permission>. qbx_core—HasPermission/GetPermission.qb-core—Functions.GetPermission.es_extended—xPlayer.getGroup()must equal the permission.
For ACE-based setups, grant the groups in your server.cfg:
add_principal identifier.license:xxxxxxxxxxxxxxxx group.admin
add_principal identifier.license:yyyyyyyyyyyyyyyy group.modDefault permissions of the basic level:
| Permission | Granted |
|---|---|
teleport | Yes |
inventory | Yes |
revive | Yes |
ropa | Yes |
bucket | Yes |
screenshot | Yes |
spectate | Yes |
giveitems | No |
video | No |
Live screen sharing (video) is never granted by default to basic staff. Create a group in the admin panel with that permission enabled and assign it to the staff members who need it.
4. Discord webhooks (optional)
All webhooks live in svconfig.lua. Replace YOUR_WEBHOOK_URL with your Discord webhook URLs, or set enabled = false to disable logging entirely.
return {
enabled = true,
webhooks = {
['report-created'] = 'https://discord.com/api/webhooks/...',
['report-claimed'] = 'https://discord.com/api/webhooks/...',
-- ...
['screenshot-upload'] = 'https://discord.com/api/webhooks/...',
}
}screenshot-upload is not a log channel: it is the webhook screenshot-basic uploads the capture to. The screenshot quick action does nothing while it is empty or still set to YOUR_WEBHOOK_URL.
See Configuration for the full list of webhook keys.
5. Language
Set the resource language in config.lua. Translation files live in locales/.
Config.Language = 'en' -- 'es' | 'en'