๐น๏ธSpectro_MultiJobs
๐ Spectro MultiJobs - Complete Documentation
Advanced multi-job management system for FiveM with admin panel, customizable interface, and multi-framework compatibility
๐ Table of Contents
๐ Key Features
โจ For Players
Multiple Simultaneous Jobs: Maintain several regular jobs and extras
Instant Switching: Toggle between jobs with a single click
Modern Interface: Intuitive and responsive design
Rank Preservation: Each job maintains its own rank
Extra Jobs: Additional jobs managed by administrators
Configurable Cooldown: Integrated system to prevent abuse
๐ ๏ธ For Administrators
Complete Panel: Total control over jobs and ranks
Player Management: Assign or modify jobs for any player
Real-Time Editing: No need to restart the server
Total Customization: Configure every aspect of the system
Boss System: Department heads can manage employees
Granular Permission Control: Define specific access by group
๐ง Technical Features
Multi-Framework: Compatibility with ESX and QBCore
Automatic Detection: Identifies and adapts to the server framework
Optimized Database: Efficient structure in MySQL
Low Resource Consumption: Optimized for busy servers
Adaptable Interface: Works at any resolution
Visual Customization: Fully adjustable theme and colors
๐ Requirements and Dependencies
๐จ Mandatory Dependencies
MySQL: Compatible with mysql-async, oxmysql, ghmattimysql
Framework: ESX or QBCore (automatic detection)
๐ Server Requirements
FiveM Version: Artifact 5181 or higher
RAM Memory: Minimum 4GB
Disk Space: 2MB
๐ Compatible Frameworks
ESX: All versions (including ESX Legacy)
QBCore: All versions
ESX Infinity/Legacy: Fully compatible
โ Compatibility Guarantee: This script works perfectly with any version of ESX and QBCore without the need for additional adjustments.
๐ง Step-by-Step Installation
Step 1: Preparation
Download the script files
Extract the content to a temporary directory
IMPORTANT: Rename the main folder to
Spectro_multijobs
Step 2: Database
-- Execute this command in your MySQL manager (phpMyAdmin, HeidiSQL, etc.)
CREATE TABLE IF NOT EXISTS `player_multijobs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(60) NOT NULL,
`job` varchar(50) NOT NULL,
`job_grade` int(11) NOT NULL DEFAULT 0,
`is_active` tinyint(1) NOT NULL DEFAULT 0,
`is_default` tinyint(1) NOT NULL DEFAULT 0,
`job_index` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Step 3: server.cfg Configuration
# Make sure you have a database system installed
ensure mysql-async # Or your preferred system (oxmysql, ghmattimysql, etc.)
# Make sure your framework is properly loaded
ensure es_extended # Or qb-core
# Finally, load the script
ensure Spectro_multijobs
Step 4: Initial Configuration
Open
config.lua
Adjust the administration groups:
Config.AdminGroups = {'admin', 'superadmin'} -- Add your admin groups
Configure the maximum number of jobs:
Config.MaxJobs = 2 -- Maximum number of regular jobs
Set the cooldown between changes:
Config.JobCooldown = 10 -- Seconds of waiting between changes
Step 5: Restart the Server
# In the server console
refresh
restart Spectro_multijobs
โ๏ธ General Configuration
๐จ Basic Configuration
Config.Locale = 'es' -- Language (currently only 'es' available)
Config.MaxJobs = 2 -- Maximum number of regular jobs
Config.Command = 'trabajos' -- Command to open the menu
Config.AdminGroups = {'admin'} -- Groups that can assign jobs
Config.JobCooldown = 10 -- Waiting time between changes (seconds)
Config.ThemeColor = '#DFF900' -- Theme color (HEX)
๐ซ Framework Configuration
Config.Framework = 'auto' -- 'auto', 'esx', 'qbcore'
Config.UseOldESXEvent = false -- For older ESX versions
-- QBCore specific configuration
Config.QBCoreName = 'qb-core' -- QBCore resource name
Config.QBCoreDefaultJob = 'unemployed' -- Default job
Config.QBCoreDefaultGrade = 0 -- Default grade
๐ญ Permission Configuration
Config.BossCanManageEmployees = true -- If bosses can manage employees
Config.MinGradesForBoss = 3 -- Minimum grades to be considered a boss
Config.NonAdminJobs = {} -- Jobs that don't require admin permissions
๐งฐ Development Configuration
Config.EnableLogs = false -- Enable debugging logs
Config.DebugMode = false -- Advanced debug mode
Config.EnableUILogs = false -- UI logs
๐ค Job System
๐ Job Types
Regular Jobs:
Limited by
Config.MaxJobs
(usually 2-3)Database indices 0-2
Manageable by the player
Extra Jobs:
No predefined limit
Database indices 3+
Only administrators can modify them
๐ Job Switching
Only one active job at a time
Instant change with automatic synchronization
Configurable cooldown to prevent abuse
Immediate update of ranks and permissions
โจ Default Jobs
Config.DefaultJobs = {'unemployed', 'unemployed'}
Automatically assigned to new players
Used when resetting jobs
Flexible configuration by position
๐ก๏ธ Admin Panel
๐ฏ Main Features
Player Management:
View all jobs for each player
Add/modify/delete jobs
Reset jobs to default values
Job Assignment:
Any job available on the server
Specific rank selection
Assignment as regular or extra job
System Configuration:
Cooldown settings, maximum jobs
Administration groups
Default jobs
Visual customization
๐ Panel Access
Only for members of groups defined in
Config.AdminGroups
Automatic permission verification when opening the menu
Real-time updates when changing permissions
๐ Permission System
๐ฎ Boss System
A player is considered a "boss" if they meet these conditions:
They have the highest rank in their job
The job has at least
Config.MinGradesForBoss
ranks (default 3)The option
Config.BossCanManageEmployees
is activated
Bosses can:
View all employees in their department
Promote employees to ranks lower than their own
Fire employees
๐ฅ Administration
Members of Config.AdminGroups
can:
Access the complete administration panel
Manage all jobs for any player
Add unlimited extra jobs
Configure all aspects of the system
๐ฅ๏ธ User Interface
๐ฑ Main Tabs
My Jobs:
Lists all your available jobs
Shows active job, ranks, and salaries
Buttons to activate or reset jobs
Manage Employees (bosses only):
List of department employees
Online/offline status of each employee
Options to change ranks
Option to fire employees
Manage Jobs (admins only):
Job assignment to players
Complete job management by player
System configuration
๐จ Visual Customization
Customizable theme color
Adjustable menu position
Fully translatable texts
โ Frequently Asked Questions
๐ Installation and Configuration
How do I open the jobs menu?
Use the
/trabajos
command (or the one configured inConfig.Command
)Make sure you have the appropriate permissions
Verify that the script is correctly installed
Is the script compatible with my ESX/QBCore version?
Yes, it's compatible with all versions of ESX and QBCore
The system automatically detects the framework
No additional configuration required to work
Can I change the maximum number of jobs?
Yes, modify
Config.MaxJobs
in config.luaOnly affects regular jobs
Extra jobs have no predefined limit
How do I add administrators?
Add the groups in
Config.AdminGroups = {'admin', 'superadmin', 'moderator'}
Make sure players have these groups in your framework
Restart the script after modifying the configuration
๐ Features and Usage
Are jobs saved when restarting the server?
Yes, all jobs are stored in the database
They persist between restarts and reconnections
Include jobs, ranks, and states
How do extra jobs work?
Extra jobs are assigned by administrators
They don't count towards the regular job limit
They can only be modified by administrators
They have index 3 or higher in the database
Can players delete their own jobs?
They can reset regular jobs to default values
They cannot delete extra jobs
Administrators can delete any job
How does the boss system work?
A player with the highest rank in a job is considered a boss
The job must have at least
Config.MinGradesForBoss
ranksBosses can manage employees from the main menu
They can promote/fire employees in their department
๐ Customization and Advanced
Can I change the visual appearance of the menu?
Yes, through
Config.ThemeColor
to change the main colorCustomize the menu position
Modify texts through the localization system
Does the system work with custom jobs?
Yes, compatible with any job configured in your framework
Automatically detects jobs and ranks
Works with custom or modified jobs
Can I limit which jobs administrators can assign?
Yes, configure
Config.NonAdminJobs
with allowed jobsSet specific permissions by group
Differentiate between regular and extra jobs
Can it be used on servers with many players?
Yes, the system is optimized for large servers
Low resource consumption
Efficient data caching
โ ๏ธ Common Troubleshooting
๐ The Menu Doesn't Open
The command doesn't work
The command is misconfigured
Check Config.Command
in config.lua
Conflict with another script
Change the command in config.lua
Nothing appears when using the command
Incorrect resource name
Rename the folder to exactly Spectro_multijobs
NUI not loading
Verify that html, css, and js files exist
Console error
JavaScript error
Check the F8 console for specific errors
Resources loaded in incorrect order
Make sure to load your framework first
๐ด Database Errors
"MySQL not found" error
Database system not loaded
Make sure to load mysql-async or another system
Database connection error
Incorrect credentials
Check connection settings
"player_multijobs not found" error
Table not created
Execute the SQL in the installation section
"identifier not found" error
Incompatible identifier
Check Config.ColumnMapping
๐ Framework Problems
"ESX not found" error
ESX not loaded correctly
Make sure to load es_extended first
Old ESX version
Activate Config.UseOldESXEvent = true
"QBCore not found" error
QBCore not loaded
Verify that qb-core is loaded
Custom QBCore name
Configure Config.QBCoreName
Jobs don't update
Framework event not detected
Activate debug mode to identify the problem
๐ก Permission Problems
Admin tab not showing
You're not in an admin group
Add your group to Config.AdminGroups
Permission detection problem
Verify your player's group in the framework
Boss tab not showing
You don't have the highest rank
Make sure you have the highest rank
Insufficient ranks in the job
The job needs Config.MinGradesForBoss
ranks
Bosses can't manage employees
Option disabled
Activate Config.BossCanManageEmployees = true
๐ต Specific Code Errors
attempt to index a nil value (field 'Config')
config.lua not loaded
Verify it's included in fxmanifest.lua
attempt to index a nil value (field 'JobGrades')
Job data not loaded
Wait for the server to fully load
table index is nil
Access to non-existent data
Activate debug mode to identify
ESX.RegisterServerCallback is not a function
Framework not initialized
Make sure the framework is fully loaded
๐ค Performance Issues
Lag when opening the menu
Many jobs/ranks
Optimize the number of jobs/ranks
High CPU usage
Too many players changing jobs
Increase Config.JobCooldown
Slow response times
Slow database queries
Optimize database indices
Momentary freezes
Synchronous operations
Reduce logs and debug if activated
๐ Advanced Configuration
๐ Advanced Database Settings
-- Customization of tables and columns
Config.DatabaseTables = {
users = 'users', -- Users table (ESX: users, QBCore: players)
jobs = 'jobs', -- Jobs table
jobGrades = 'job_grades' -- Ranks table
}
-- Column mapping between frameworks
Config.ColumnMapping = {
identifier = {
esx = 'identifier', -- Identifier column in ESX
qbcore = 'citizenid' -- Identifier column in QBCore
}
}
๐ก๏ธ Advanced Permission Configuration
-- Boss configuration
Config.BossCanManageEmployees = true -- If bosses can manage employees
Config.MinGradesForBoss = 3 -- Minimum ranks to be considered a boss
-- Jobs that don't require administrator permissions
Config.NonAdminJobs = {
"police", -- Allow assigning police job
"ambulance", -- Allow assigning medic job
"mechanic" -- Allow assigning mechanic job
}
๐ง Debugging Settings
-- Complete debugging enablement
Config.EnableLogs = true -- Show logs in the server console
Config.DebugMode = true -- Activate detailed debug mode
Config.EnableUILogs = true -- Show NUI logs in the client console
-- Shows detailed information about:
-- - Framework detection
-- - Loading jobs and ranks
-- - Job assignment
-- - Job changes
-- - Specific errors
๐ Support and Contact
โ ๏ธ Before Requesting Support
Verify that you have followed the installation instructions exactly
Check the troubleshooting section
Activate debug mode to identify specific errors:
Config.EnableLogs = trueConfig.DebugMode = trueConfig.EnableUILogs = true
Restart the script after any configuration changes
๐ Information to Provide
When requesting support, always include:
Exact script version
Framework used (ESX or QBCore) and its version
Server logs with debug mode activated
Detailed description of the problem
Steps to reproduce the error
๐ ๏ธ Diagnostic Tools
-- Activate debug mode in config.lua:
Config.DebugMode = true
-- Verify the database:
SHOW TABLES LIKE 'player_multijobs';
SELECT * FROM player_multijobs LIMIT 10;
-- Check resource loading:
ensure mysql-async # Or your database system
ensure es_extended # Or qb-core
ensure Spectro_multijobs
Documentation updated for Spectro_multijobs v1.0.1 Last update: 2025
Last updated