ESX

This guide covers setup for ESX Legacy, ESX Core, and Final V1 forks.


1. Framework Setting

In config.lua, set:

Lua
Config.Framework = 'esx' -- supports 'esx', 'esx_legacy', 'esx_finalv1', or 'auto'

2. Boss Permissions & Job Grades

In ESX, boss permissions are resolved through your job_grades database table or ESX.GetJobs():

  • A player is considered a boss if their grade name is boss or has the isboss = true flag set in the framework.

  • Example SQL grade configuration:

    SQL
    INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES
    ('police', 0, 'recruit', 'Recruit', 50, '{}', '{}'),
    ('police', 1, 'officer', 'Officer', 75, '{}', '{}'),
    ('police', 2, 'sergeant', 'Sergeant', 100, '{}', '{}'),
    ('police', 3, 'lieutenant', 'Lieutenant', 125, '{}', '{}'),
    ('police', 4, 'boss', 'Chief of Police', 150, '{}', '{}');

3. Paycheck Handling

  1. Disable the native ESX paycheck loop in es_extended/config.lua to avoid double payments:

    Lua
    Config.EnablePaycheck = false
  2. Alternatively, route ESX paychecks through finals_management by calling:

    Lua
    exports['finals_management']:AddPendingPaycheck(xPlayer.source, xPlayer.job.grade_salary, xPlayer.job.name)

4. Player Metadata & Disciplinary Actions

Disciplinary records (Red Cards, Personnel Badges) and On-Site post restrictions are stored in users.metadata as a JSON string, ensuring data persists across server restarts without polluting primary database columns.