NX CreativeNX CreativeDocs
Scriptsnx_employeemanagement

Configuration

Every entry in shared/config.lua. Defaults, types, and purpose.

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. See Localization below.

Webhook URLs live in a separate shared/server-config.lua file that is loaded only on the server. See Webhooks below.

Core

Config.Frameworkstringdefault: 'ESX'

Framework identifier. One of 'ESX', 'QB', 'QBX'.

Config.Inventorystringdefault: 'OX'

Inventory backend for the tablet item. One of 'OX', 'QB'.

Config.Targetstringdefault: 'OX'

Target resource identifier. Currently only 'OX' is supported.

Config.Languagestringdefault: 'en'

Active UI language. Selects the matching locales/<lang>.lua file. Shipped: 'en', 'fi', 'es', 'fr', 'it', 'de', 'sv'.

Integrations

Config.Integrations.MultiJobstringdefault: 'none'

Optional multi-job backend. One of 'none', 'core_multijob'.

Config.Integrations.MultiJobTablestringdefault: 'user_jobs'

Database table name for the core_multijob integration.

Config.Integrations.MultiJobFallbackJobstringdefault: 'unemployed'

Job assigned when an employee has no other jobs remaining.

Tracking

Config.UpdateIntervalnumberdefault: 5

Minutes between working-time accumulator updates.

Config.TrackOnlyOnDutybooleandefault: true

When true, only accumulate hours for players flagged as on duty by the framework.

Config.ResetHoursOnTrackingStartbooleandefault: false

When true, reset an employee's tracked hours to zero the moment they start tracking a job.

Config.ResetHistoryOnHoursResetbooleandefault: true

When a boss resets an employee's hours, also clear their daily work history for that job.

Config.SelfServicetabledefault: { Enabled = true }

Controls the non-boss self-service panel. Set Enabled = false to restrict the tablet to management.

Permissions

Config.UIKeystringdefault: 'F7'

Default keybind for /employeelist. Registered via RegisterKeyMapping so players can rebind it. The command and keybind only exist when Config.Tablet.access.mode is 'key' or 'key+item'.

Config.AllowedRankstabledefault: { default = { boss = true, chief = true, manager = true } }

Per-job grades treated as management. Keys are job names, values are tables of allowed grades. Each entry can be keyed by grade name (string) or grade level (number), or mix both. Values must be true to grant access. The 'default' entry is the fallback used for any job without an explicit entry.

Config.IsBossRankfunction

Resolves whether a (jobName, gradeName, gradeLevel) tuple has boss access. Signature: Config.IsBossRank(jobName, gradeName, gradeLevel). Either gradeName or gradeLevel may match an entry in Config.AllowedRanks. Falls back to Config.AllowedRanks['default'] when the job has no explicit entry. Used by both client and server permission checks.

Example: limit police to grade name boss, allow mechanic grade levels 3 and 4, mix names and levels for ambulance, and let every other job fall back to the default ranks.

Config.AllowedRanks = {
    ['default']   = { ['boss'] = true, ['chief'] = true, ['manager'] = true },
    ['police']    = { ['boss'] = true },                -- by grade name
    ['mechanic']  = { [3] = true, [4] = true },         -- by grade level
    ['ambulance'] = { ['chief'] = true, [4] = true }    -- mixed
}

Rank permissions

Boss ranks always have full access. From the Permissions tab in the menu, a boss grants each non-boss grade access to specific tabs. Grants are stored in the employee_rank_permissions table, created automatically on first start, and apply without a restart.

Non-boss grades holding the boss-actions grant cannot escalate. They can only hire and promote to grades below their own, and they cannot fire or modify employees at or above their own rank.

Config.Permissions.Enabledbooleandefault: true

Master toggle for granular rank permissions. When false, non-boss ranks can never be granted access. Self-service keeps working.

Config.Permissions.Keysstring[]default: { 'employees', 'management', 'payroll', 'bossActions', 'society' }

Feature areas a boss can grant. Removing a key hides its column in the Permissions tab and blocks the server-side actions behind it for non-boss ranks.

Tablet

Behaviour toggles for the handheld tablet.

Config.Tablet.Enabledbooleandefault: true

Master toggle for the tablet item flow.

Config.Tablet.access.modestringdefault: 'item'

How the menu opens. One of 'key', 'item', 'key+item', 'zone'. In 'zone' mode only the locations in Config.Zones open the menu.

Config.Tablet.access.itemstringdefault: 'jobtablet'

Inventory item id for the tablet.

Config.Tablet.autoClosetabledefault: { onWeapon = true, onCombat = true, onRagdoll = true, onDeath = true }

Close the tablet automatically when the player draws a weapon, enters combat, ragdolls, or dies.

Config.Tablet.hints.enabledbooleandefault: true

Show hint prompts while the tablet is open.

Config.Tablet.camera.toggleEnabledbooleandefault: true

Allow toggling the locked tablet camera.

Config.Tablet.camera.toggleCommandstringdefault: 'tabletcam'

Command name registered for the camera toggle. Only registered when toggleEnabled is true.

Config.Tablet.camera.toggleKeystringdefault: 'F6'

Default key bound to the camera toggle command.

Interaction zones

Fixed world locations that open the management menu as a flat window, without the tablet item or camera. The window renders at the same resolution as the tablet's screen, so both modes look identical. Access is permission-checked the same way as every other entry point. To make zones the only way to open the menu, set Config.Tablet.access.mode = 'zone'.

Config.Zones.Enabledbooleandefault: false

Master toggle for interaction zones.

Config.Zones.Locationstable[]default: {}

Zone definitions. Fields per entry: label (string), coords (vec3), radius (number), interaction ('target' for an ox_target sphere zone, 'textui' for an ox_lib TextUI prompt with E), icon (Font Awesome class, used by 'target'), jobs (array of job names allowed to use the zone, omit to allow any job), bossOnly (boolean, hides the zone from non-boss employees).

Config.Zones = {
    Enabled = true,
    Locations = {
        {
            label = "Management",
            coords = vec3(449.8653, -973.8475, 30.6896),
            radius = 1.5,
            interaction = "target",
            icon = "fa-solid fa-briefcase",
            jobs = { "police" },
            bossOnly = false
        }
    }
}

Hire scope

Config.HireScope.defaultModestringdefault: 'nearby'

Initial scope of the hiring console. One of 'nearby', 'server'. 'nearby' lists only players within nearbyRadius metres. 'server' lists every online player and falls back to 'nearby' when allowServerWide is false.

Config.HireScope.nearbyRadiusnumberdefault: 10.0

Radius in GTA world units (approximately metres) used by the 'nearby' hire mode.

Config.HireScope.allowServerWidebooleandefault: false

When true, exposes the 'Server-wide' tab in the hiring console so bosses can list every online player. When false, the tab is hidden and the server rewrites unscoped requests to the nearby radius.

Time display

Config.DisplayFormatstringdefault: 'hours'

Time display format. One of 'hours', 'minutes', 'both'.

Config.TimeFormatstable

Per-language printf-style format strings. Keys are language codes ('en', 'fi'). Each entry has hours, minutes, and both fields. Falls back to the 'en' entry when the active language is missing keys.

Config.TimeFormattable

Legacy alias for the active language's TimeFormats entry. Kept for external callers. Prefer Config.TimeFormats for new code.

Payroll

Config.Payroll.Enabledbooleandefault: true

Master toggle for all payroll features. When false, invoicing, society, and auto-pay are disabled.

Config.Payroll.Modestringdefault: 'tablet'

Default payroll mode for every job. One of 'tablet' (hour-tracked payroll managed by this resource) or 'framework' (delegate to the framework's built-in paycheck thread, e.g. ESX paycheck.lua paying job_grades.salary).

Config.Payroll.PerJobModestabledefault: {}

Per-job override of Config.Payroll.Mode. Keys are job names, values are 'tablet' or 'framework'. Example: { police = 'framework', ambulance = 'framework' }.

Config.Payroll.MaxWagePerJobtabledefault: { default = 5000 }

Maximum wage allowed when editing from the tablet. The server clamps writes to this value. The 'default' entry covers any job not listed; per-job entries override it. In tablet mode the cap applies to hourly_rate, overtime_rate, and base_salary. In framework mode it caps the per-tick salary written to job_grades.salary. Use math.huge to disable the cap.

Config.Payroll.HoursPerPayCyclenumberdefault: 40

Hours per pay cycle. Used when converting a job's base salary into an hourly rate.

Config.Payroll.ResetHistoryOnPaybooleandefault: true

Reset an employee's daily work-history rows after their salary is paid.

Society funds

Config.Payroll.Society.UseSocietyFundsbooleandefault: true

When true, payroll and invoice payouts are debited from the society account. Set false to disable the debit (useful during testing).

Config.Payroll.Society.Backendstringdefault: 'auto'

Society-account backend. One of 'auto', 'esx_addonaccount', 'fd-banking', 'qb-management', 'qb-banking', 'renewed-banking', 'database'. 'auto' probes the running resources and picks the first match.

Config.Payroll.Society.QBTableNamestringdefault: 'management_funds'

Table name used by the qb-management backend.

Auto-pay

Only applies to tablet-mode jobs. Framework-mode jobs are paid by the framework's own paycheck thread.

Config.Payroll.AutoPay.Enabledbooleandefault: true

Run the auto-pay scheduler on the server.

Config.Payroll.AutoPay.Schedulestringdefault: 'weekly'

Pay cycle. One of 'daily', 'weekly', 'biweekly', 'monthly', 'interval'. Use 'interval' to fire on a fixed period instead of a calendar day.

Config.Payroll.AutoPay.PayDaynumberdefault: 1

Day of week or day of month depending on Schedule. Weekly uses 1 = Monday. Monthly accepts 1..31. Ignored when Schedule is 'interval'.

Config.Payroll.AutoPay.PayHournumberdefault: 10

Hour of day (24h) when auto-pay runs. Ignored when Schedule is 'interval'.

Config.Payroll.AutoPay.Intervaltabledefault: { Unit = 'minutes', Value = 30 }

Only used when Schedule is 'interval'. Fires every Value units regardless of PayHour or PayDay. Unit is one of 'minutes', 'hours', 'days'.

Invoices

Config.Payroll.Invoices.MaxPendingPerEmployeenumberdefault: 5

Maximum simultaneous pending invoices per employee.

Config.Payroll.Invoices.AutoApproveUndernumberdefault: 1000

Invoices with amount under this value skip review and auto-approve.

Config.Payroll.Invoices.RequireApprovalOvernumberdefault: 5000

Invoices over this amount always require boss review, even if other rules would auto-approve.

Default rates

Config.Payroll.DefaultRates.hourlynumberdefault: 25.00

Default hourly rate when no per-grade rule exists.

Config.Payroll.DefaultRates.commissionnumberdefault: 0.05

Default commission rate. 0.05 = 5 percent.

Config.Payroll.DefaultRates.overtime_multipliernumberdefault: 1.5

Overtime pay multiplier applied above the threshold.

Config.Payroll.DefaultRates.overtime_thresholdnumberdefault: 1500

Minutes worked before overtime kicks in. 1500 = 25 hours.

Reporting

Config.Payroll.Reporting.Enabledbooleandefault: true

Enables the Discord summary endpoint and boss-menu report buttons. The webhook URL itself is configured in shared/server-config.lua.

Config.Payroll.Reporting.MaxRangeDaysnumberdefault: 93

Maximum number of days that can be selected for a single report.

Config.Payroll.Reporting.IncludeTopEmployeesbooleandefault: true

Append a ranked top-employee list to the Discord summary.

Webhooks (server-only)

These values live in shared/server-config.lua, which is loaded only on the server (declared in server_scripts) and listed in escrow_ignore so it stays editable.

Config.Webhooks.LogsWebhookUrlstringdefault: ''

Discord webhook URL for activity logs (hires, fires, grade changes, society deposits and withdrawals, payroll rule edits, salary payments, invoice approvals and rejections). Leave empty to disable activity logging.

Config.Webhooks.LogsUsernamestringdefault: 'NX Employee Management'

Username used in the activity-log Discord embeds.

Config.Webhooks.LogsAvatarUrlstringdefault: ''

Optional avatar image URL for the activity-log embeds. Leave empty for none.

Config.Webhooks.PayrollSummaryWebhookUrlstringdefault: ''

Discord webhook URL used by the manual 'Send Discord Summary' report generator in the payroll panel. Leave empty to disable summary reports.

Config.Webhooks.PayrollSummaryUsernamestringdefault: 'Company Payroll Reports'

Username used in the payroll summary embed.

Localization

Translations live in locales/<lang>.lua, one file per language. Shipped languages: en, fi, es, fr, it, de, sv. The files are listed in escrow_ignore, so they stay editable after install. To add a language, copy locales/en.lua, rename the table key, and translate the strings. New files load automatically.

Config.Localetable

String table keyed by language code. Each locales/<lang>.lua file fills one key. Non-English locales are merged with 'en' at load time so missing keys fall back to English.

Config.Translatefunction

Translate helper. Signature: Config.Translate(key, ...). Returns the formatted string for the active language, falling back to English, then to the key itself.