NX CreativeNX CreativeDocs
Scriptsnx_employeemanagement

Installation

Resource-specific setup for nx_employeemanagement. Dependencies, SQL import, tablet item, and server.cfg order.

For server-wide prerequisites (artifacts, oxmysql, ox_lib), work through the generic install guide first. This page only lists what is specific to nx_employeemanagement.

Dependencies

Framework is set explicitly through Config.Framework. Pick ESX, QB, or QBX to match your core.

ox_lib
Required

Callbacks, notifications, context menu, and keybind registration.

oxmysql
Required

Database driver. Required for hours, payroll, invoices, and society tables.

nx-3d
Required

Renders the tablet prop, DUI screen, and animation pipeline. Must start before nx_employeemanagement.

ox_inventory
Optional

Default inventory backend for the tablet item. Use qb-inventory by setting Config.Inventory = "QB".

Database import

Import the SQL file that matches your framework:

# ESX Legacy
mysql -u <user> -p <database> < sql_esx.sql

# QBCore
mysql -u <user> -p <database> < sql_qb.sql

# QBox
mysql -u <user> -p <database> < sql_qbx.sql

The import adds three tracking columns to your users / players table (workingtime, trackedjob, last_work_timestamp) and creates these tables:

  • employee_work_history. Daily minutes-worked records per identifier and job.
  • employee_job_changes. Hire, fire, and grade-change audit log.
  • employee_payroll_rules. Per-job, per-grade payment configuration.
  • employee_invoices. Invoice records with status, amounts, and approval metadata.
  • payroll_transactions. Salary, commission, bonus, invoice, and deduction ledger.
  • employee_society_transactions. Deposit and withdraw audit log for the society account.

Tablet item

The tablet is an inventory item. The item key is jobtablet by default. Change it through Config.Tablet.access.item.

ox_inventory

Set Config.Inventory = "OX" and add this to ox_inventory/data/items.lua:

['jobtablet'] = {
    label = 'Company Tablet',
    weight = 50,
    stack = false,
    close = true,
    client = {
        export = 'nx_employeemanagement.useJobTablet'
    }
}

qb-inventory

Set Config.Inventory = "QB". The resource registers the usable item through QBCore.Functions.CreateUseableItem on start, and attempts to register it with QBCore.Shared.Items via exports['qb-core']:AddItem if missing. To define it manually in qb-core/shared/items.lua:

['jobtablet'] = {
    name = 'jobtablet',
    label = 'Company Tablet',
    weight = 50,
    type = 'item',
    image = 'jobtablet.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'Access company management tools'
}

server.cfg order

ensure oxmysql
ensure ox_lib
ensure ox_inventory    # or qb-inventory

ensure nx-3d
ensure nx_employeemanagement

nx-3d must start before nx_employeemanagement. The tablet prop, DUI screen, and animation pipeline depend on it.

Optional core_multijob integration

Let employees hold multiple jobs without conflict. In shared/config.lua:

Config.Integrations.MultiJob = "core_multijob"
Config.Integrations.MultiJobTable = "user_jobs"
Config.Integrations.MultiJobFallbackJob = "unemployed"

The integration reads and writes the existing core_multijob user_jobs table only. It does not create new tables and does not modify schema.

Config location

All settings live in shared/config.lua. The file is in escrow_ignore so it remains editable after install. UI translations live in locales/<lang>.lua, one file per language, also unescrowed. To add a language, copy locales/en.lua, rename the table key, and translate the strings. See Configuration for every option.