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".

nx_phone
Optional

Optional. Pay messages land in the phone's Wallet app instead of a notification, and players can hold several jobs through its Shift app (Config.Integrations.MultiJob = "nx_phone").

lb-tablet
Optional

Only needed if you want to run the panel as an app inside LB Tablet rather than as its own tablet. Set Config.LBTablet.Enabled = true.

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, plus rows other scripts post with AddCompanyTransaction.
  • employee_autopay_state and employee_pending_payments. AutoPay schedule state, and payments waiting for an offline player's next login.
  • employee_rank_permissions and employee_custom_membership. Rank grants from the Permissions tab, and the last known grade of custom job members.
  • employee_hire_offers, employee_payroll_runs, employee_payroll_run_items and employee_audit_log. Job offers, every payroll run and who it paid, and a log of every money and staff action.

nx_computer's Employees app uses the same tables, so the two always show the same data.

Updating from an older version

Start the resource once with the database reachable. It creates the missing tables and columns and migrates the existing ones in place; no data is removed. You don't need to import the SQL file again.

In tablet payroll mode your framework still runs its own paycheck. The server console warns at start for every job that is paid twice. Set those framework salaries to 0, or put the job in 'framework' mode with Config.Payroll.PerJobModes.

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, screen, and animation pipeline depend on it.

If you run the LB Tablet app mode, ensure lb-tablet before nx_employeemanagement as well, so the app is registered against a host that is already running.

LB Tablet app mode

Optional. Runs the whole panel as an app inside your server's existing LB Tablet instead of giving every boss a second tablet. In shared/config.lua:

Config.LBTablet = {
    Enabled  = true,
    Resource = "lb-tablet",   -- your LB Tablet resource folder name

    App = {
        identifier = "nx_employeemanagement",
        name       = "Employees",
        icon       = "inventory-images/jobtablet.png",
        defaultApp = true      -- pre-installed on every tablet
    },

    HideWhenNoAccess = true    -- hide the icon while the player has nothing to manage
}

Two things to know before you switch:

  • Enabling this turns off every other entry point. The handheld prop, the tablet item, the Config.UIKey keybind, the tabletcam command, and Config.Zones all stand down. LB Tablet exposes no export for opening a specific app from Lua, so there is nothing for those triggers to route to. The app is the only way in.
  • Remove the jobtablet item from your inventory config. The item is inert in this mode rather than broken, but leaving it in place gives players something that does nothing when used.

nx-3d is still a hard dependency and must still start first, even though the prop is not used in this mode. The resource will not start without it.

Custom job providers

Optional. Brings standalone job scripts (SouF UwU Cafe, BurgerShot, any self-contained job resource) into the tablet alongside your framework jobs. These jobs do not need to exist in jobs.lua or job_grades.

Set Config.CustomJobs.Enabled = true and add one entry per business under Config.CustomJobs.Jobs. Each entry declares the grade table, how an online member and grade are detected (through the external script's public exports or a statebag), where the roster comes from, and whether hiring, payroll, and society are enabled for that job.

Hiring, firing, and promotion are read-only by default: keep staffing in the external script's own boss menu, or opt in per job with a write adapter. Payroll and Society are off by default so you do not double-handle the external economy.

The shipped INSTALLATION.md, section "Custom Job Providers", carries the full field guide and the limits (live grade is read only while the player is online, the roster comes from this resource's own hour tracking unless you point it at a table, and writes are opt-in). See Configuration for every field.

Optional nx_phone integration

Two things change when nx_phone runs next to this resource.

Pay messages go to the phone. When a payment reaches a player (salary, AutoPay, Pay Now, bonus or invoice), the "Payroll payment received" message lands in the phone's Wallet app. Without nx_phone, or when the player carries no phone, it shows as the usual notification. Payments from the same job that land within 20 seconds of each other are summed into one message ("$450 (3 payments)"), and a total under $1 is held back until the next payment brings it over. The money itself is in the bank right away. This needs no setup; see Pay notifications to change it.

Players can hold several jobs. Set:

Config.Integrations.MultiJob = "nx_phone"

Hires, grade changes and fires then go through nx_phone's job list, and players switch the job they are working in the phone's Shift app. nx_phone must allow this resource in its Config.Shift.MultiJob.ExportResources (its default already does). The start order in server.cfg does not matter for this.

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.

NX Docs