Skip to content

Configuration ​

Everything lives in one table, Config.VehicleManufacturing, in shared/config.lua. The file is shared (client and server) and sent to every client, so keep secrets out of it: the Discord webhook URL goes into a server convar (see Notifications). The vehicle templates and parts are in shared/catalog.lua (see Templates & catalog).

Gameplay transactions stay fail-closed until you configure workshops, permissions and at least one approved template. While authorization.allowAllPlayers, enableFixtureCatalog or developmentCommands is true, the server prints one development configuration warning at start-up; see Going live.

General ​

Option Default Description
enabled true Master switch. When false, the laptops are registered disabled (np_prophandler does not spawn them) and every RPC is refused
developmentCommands false Registers np_manufacturing_open / np_manufacturing_close (open the console anywhere)
debug false Debug prints on client and server
locale 'en' NUI language: 'en' or 'de'

Feature switches ​

Option Default Description
requireRegisteredTemplate true A vehicle needs an approved template to pass the template bay check
allowAdminUnregisteredInspection true Admins may open a session on a vehicle without a template (to onboard it)
requireServerApproval true Builds start as pending and need an approver. Approvers' own builds are auto-approved. With false every build is approved on submit
allowRuntimeTexturePreview false Enables the runtime_texture mode and the live draft preview on the car. Players also need np_manufacturing.runtime_livery. See the note below
runtimeSlots.enabled false Enables the runtime_slot mode (Per car): a separate live design per car through a template's liverySlots. Players also need np_manufacturing.runtime_livery. See Runtime slots
allowPrebuiltApplication false Enables the prebuilt mode (an external resource applies a shipped texture). See Templates & catalog
allowPlayerUploads true Players may upload images (PNG, JPEG, WebP) into the livery studio
allowPlayerAttachmentPlacement true Players may move parts away from their default transform (within the part's limits)
allowEphemeralVehicleIdentity false Fall back to the network id as vehicle identity (lost when the entity despawns). With requireStablePlayerIdentifier = false it also allows source:<id> player keys
allowPlateIdentityFallback false Fall back to model + plate as vehicle identity
enableFixtureCatalog true Load the development fixtures from shared/catalog.lua (sourceKind = 'fixture')

Runtime textures are global per texture target

runtime_texture replaces one texture of the game (AddReplaceTexture), and that replacement applies to every vehicle that uses the same texture target, not just one car. When two nearby vehicles with different runtime builds share a target, the closest one wins. Only enable it for templates whose target is unique to that model, and test it with your fleet first. native_livery (switching between the model's built-in livery slots) has no such limit, and runtime_slot gives each car its own design on prepared models (Live liveries).

Runtime slots ​

lua
runtimeSlots = {
  enabled = false,
  renderDistance = 80.0,
  releaseDistance = 100.0,
  maxActiveTextures = 16,
  conflictRadius = 400.0,
  reassignIntervalSeconds = 5,
},
Option Default Description
enabled false Master switch for the runtime_slot mode. Off: runtime_slot_disabled
renderDistance 80.0 A client renders a slot's design when a car using it is this close (metres, capped at 100)
releaseDistance 100.0 ...and releases it beyond this distance (capped at 100). Out of range the car shows the slot's stock texture
maxActiveTextures 16 Slot textures (one DUI each) per client at once, nearest first
conflictRadius 400.0 One slot may show different designs only on cars farther apart than this. Keep it larger than releaseDistance
reassignIntervalSeconds 5 Server pass that releases gone cars, resolves slot conflicts and serves waiting cars

The 100 m cap is the radius in which clients report cars to the server: a slot of a car nobody reports is released, so a client never draws a design for a car the server has no slot for. How slots are assigned and how to prepare a model: Live liveries & baking.

Limits ​

Option Default Description
maxDraftBytes 2 MB Serialized draft size
maxAssetBytes 4 MB One uploaded image or texture (data URL length)
maxStateBytes 32 MB Whole persisted state. Writes that would exceed it fail
minCanvasSize / maxCanvasSize 128 / 1024 Allowed livery canvas sizes
maxLayers 64 Layers per draft, including template-locked layers
maxAttachmentsPerBuild 16 Parts per build
maxWeightKg 120 Total part weight per build (0 disables the check)
maxAttachmentPresetsPerOwner 100 Equipment presets per player
maxAttachmentPresetNameLength 80
maxProjectsPerOwner 100 Livery projects per player
maxAssetsPerProject 64 Uploaded images per project
maxProjectNameLength 80
maxAuditEntries 1000 Audit log entries kept in the state

Timing and distances ​

Option Default Description
sessionTimeoutSeconds 900 Bay lock / session lifetime without activity
cleanupIntervalSeconds 30 Interval of the server cleanup loop (expired sessions, job timeouts)
maximumVehicleSpeed 0.5 m/s; faster counts as "not stationary"
playerComputerDistance 4.0 Default computer interaction radius (a workshop's computerRadius overrides it)
vehicleBayDistance 8.0 Default bay radius (a workshop's bayRadius overrides it)

Persistence ​

lua
persistenceAdapter = 'flatfile', -- or 'oxmysql'
persistence = {
  primaryPath = 'server/data/state-a.json',
  secondaryPath = 'server/data/state-b.json',
  oxmysql = { table = 'np_manufacturing_state' },
},

flatfile writes two alternating JSON slots inside the resource, so a crash mid-write never loses the last good state. oxmysql needs the oxmysql resource and sql/np_manufacturing.sql. See Installation.

Authorization ​

lua
authorization = {
  allowAllPlayers = true,              -- development only: everyone has every role
  requireStablePlayerIdentifier = true, -- players need a Rockstar license identifier
  usePermission = 'np_manufacturing.use',
  approvePermission = 'np_manufacturing.approve',
  administerPermission = 'np_manufacturing.admin',
  mechanicPermission = 'np_manufacturing.mechanic',
  emergencyEquipmentPermission = 'np_manufacturing.emergency',
  runtimeLiveryPermission = 'np_manufacturing.runtime_livery', -- live modes: runtime_texture, runtime_slot
},
Option Description
allowAllPlayers Set to false on a public server. Grants every role and every organization to everyone
requireStablePlayerIdentifier Owner keys are the Rockstar license identifier. Players without one can't open a session
*Permission np_admin permission nodes for the six roles. See Roles
runtimeLiveryPermission Needed to submit, clone, apply, roll out and preview builds in the live modes, on top of allowRuntimeTexturePreview / runtimeSlots.enabled. See Live liveries

Permissions are np_admin nodes, not ACE: grant them in np_admin. Without np_admin running, only the console, the np_admin_fallback identifiers and, on ESX, the groups in np_admin_fallback_groups pass. See Permissions. The v1 options useAce, acceptLegacyAce and legacyPrefix are removed; the old npv.vehiclemanufacturing.* names are no longer read.

Rate limits ​

Every RPC belongs to a bucket: { windowSeconds, maximum } per player.

Bucket Default Used by
session 4 / 10 s requestSession
probe 15 / 10 s bayProbe (the live checklist)
read 30 / 10 s Lists, loads, quotes
asset 60 / 10 s loadAsset only (thumbnail grids, logos; the NUI runs at most 4 at once)
save 12 / 30 s Projects, drafts, logos, presets, comments
upload 4 / 60 s Image uploads, photo saving
apply 6 / 30 s Submit, clone, apply, revert, cancel job
administration 12 / 30 s Review actions, rollouts, catalog, onboarding, brand kits
jobStep 20 / 10 s In-world job step start / complete
sync 10 / 10 s The 30-second application sync
texture 10 / 30 s Runtime and per-car texture downloads

closeSession has its own small bucket (6 / 10 s). Buckets missing from an older config fall back to these defaults.

Trusted resources ​

lua
trustedServerResources = {
  -- ['persistent-vehicles'] = true,
},

Other resources may call the privileged server exports (registerTemplate, registerAttachment, setTemplateStatus, setAttachmentStatus, queueBuildForVehicle) only when listed here. The resource itself and the server console are always trusted. See Exports.

Prebuilt adapter ​

lua
prebuiltAdapter = {
  resourceName = nil,
  applyExport = 'applyVehicleArtifact',
  clearExport = 'clearVehicleArtifact',
},

Defaults for the prebuilt application mode. A template's prebuiltArtifact can override each value. See Prebuilt artifacts.

Workshops ​

lua
workshops = {
  mrpd_bay1 = {
    enabled = true,
    label = 'LSPD Mission Row · Bay 1',
    computerModel = 'prop_laptop_01a',
    computer = { x = 441.2, y = -981.9, z = 30.7 },
    computerHeading = 90.0,
    computerRadius = 4.0,
    bay = { x = 449.0, y = -975.0, z = 25.7 },
    bayRadius = 8.0,
    allowedModes = { inspect = true, edit = true, attachment = true },
    -- organizationId = 'lspd',          -- optional: only this organization's queued rollouts apply here
    -- organizations = { 'lspd', 'bcso' }, -- optional: several organizations
  },
},
Key Description
enabled Switch one workshop off
label Shown in the console header, job HUD and notifications
computerModel The laptop at computer: an np_prophandler streamed prop registered by the server (np_manufacturing:laptop_<workshop>, no collision)
computer, computerHeading, computerRadius Where the laptop stands. Its interact option opens the console within computerRadius (max 10 m; hidden while the console is open, via setCanInteract), which is also the server's "player at computer" check
bay, bayRadius The sphere the vehicle must be parked in. The server uses this spherical check as the authoritative baseline
allowedModes Optional. What a session in this workshop may do (see below). Without the table, everything is allowed
organizationId / organizations Optional. Restricts which organizations' queued rollouts are applied in this bay. Without either, any organization's queue applies here

With an allowedModes table, only modes set to true are allowed; anything else fails with workshop_mode_not_allowed:

Mode Gates
inspect Opening a session at all
edit Livery editing: creating projects, saving drafts and logos, uploading images, and submitting a build with livery layers of its own (template-locked layers don't count)
attachment Equipment: any non-empty parts list (validate, quote, presets, submit)

For example, allowedModes = { inspect = true, attachment = true } makes an upfitting bay where cars get parts but no new livery.

The shipped development_lspd entry is a development fixture; replace it.

Capturing a workshop in game: run np_manufacturing_workshop_here <id> (or <id> computer) where the laptop should sit, then np_manufacturing_workshop_here <id> bay sitting in a car in the middle of the bay. The second call prints a complete <id> = { … }, entry to F8 and the server console; paste it inside workshops = { … }. Admins only (np_manufacturing.admin), works without developmentCommands, never writes files. <id>: letters, digits and _, starting with a letter.

Vehicle identity and state bags ​

lua
vehicleIdentity = {
  autoAssignPersistentId = true,
  persistentIdStateBagKeys = { 'vehiclePersistentId', 'persistentVehicleId' },
  organizationStateBagKey = 'vehicleOrganizationId',
},
Option Description
autoAssignPersistentId Assign a generated id (into the first key below) to a vehicle without one when a session starts
persistentIdStateBagKeys State bags read, in order, for the vehicle's persistent id. Set one from your garage script
organizationStateBagKey State bag that says which organization owns the vehicle

Organizations and visibility ​

lua
organization = {
  enabled = true,
  nodePrefix = 'np_manufacturing.organization.', -- membership node: <prefix><orgId>
  defaultProjectVisibility = 'private', -- or 'organization'
  jobMap = { -- police = 'lspd',
  },
  labels = { -- lspd = 'LSPD Fleet',
  },
},
Option Description
enabled Organization ownership checks, shared projects and fleets
nodePrefix Membership node: <nodePrefix><orgId>, granted in np_admin. Was acePrefix before the np_admin integration
defaultProjectVisibility Visibility of new livery projects when the client doesn't choose. 'organization' only sticks for members
jobMap Framework job name → organization id. Members of the job count as members. Also used to find the organization's bank account
labels Display names for organization ids
lua
visibility = {
  private = true,
  organization = true,
},

Visibility offered for new projects and equipment presets. private is always available. With organization = false, everything is forced private and nothing is shared with organization members (also when organization.enabled is off). 'organization' additionally needs the player to be a member of the vehicle's organization; otherwise the project falls back to private.

Pricing ​

lua
pricing = {
  currency = '$',
  wrapBase = 500,
  perLayer = 150,
  labourPerMinute = 450,
  wrapSecondsPerLayer = 20,
  stripSeconds = 45,
  vinylItem = 'vinyl_roll',
  vinylLabel = 'Vinyl roll',
  layersPerVinyl = 2,
},

The NUI receives this table, so its estimate matches the server bill exactly:

bill   = wrapBase + perLayer × layers + Σ part.price + labourPerMinute × labour minutes
labour = stripSeconds + wrapSecondsPerLayer × layers + Σ part.fitSeconds
materials = ceil(layers / layersPerVinyl) × vinylItem  +  each part's materials

Materials appear on the bill with amount 0; they are consumed in the job's materials step, not charged.

Production jobs ​

lua
productionJobs = {
  enabled = true,
  requireMaterials = false,
  interactDistance = 1.6,
  minimumDurationFactor = 0.8,
  jobTimeoutMinutes = 60,
},
Option Description
enabled Applying an approved build creates an in-world job. With false builds apply instantly
requireMaterials Remove the materials from the mechanic's inventory in the materials step
interactDistance Metres from a step marker to get the hold-E prompt
minimumDurationFactor The server rejects a step completed faster than duration × factor
jobTimeoutMinutes Jobs without activity for this long are cancelled (and refunded if paid)

See Production jobs.

Billing ​

lua
billing = {
  enabled = false,
  payer = 'organization', -- or 'player'
  playerAccount = 'bank',
},
Option Description
enabled Charge builds at all
payer 'organization' charges the vehicle's organization account and falls back to the requesting player; 'player' always charges the player
playerAccount Framework account used for players

See Billing and refunds.

Notifications ​

lua
notifications = {
  phone = true,
  hud = true,
  discordWebhook = '',
},
Option Description
phone Use np_phone's notify export when np_phone is started
hud Route notifications to np_hud's Notify export while the console is closed
discordWebhook Legacy fallback only, default ''. Use the convar below

Discord webhook (recommended: convar). Audit events (submit, approve, request changes, revoke, apply, rollout) are posted to the URL in the server convar np_manufacturing_webhook:

cfg
set np_manufacturing_webhook "https://discord.com/api/webhooks/..."

Use set, not setr, so it stays on the server. shared/config.lua is sent to every client, so a URL in discordWebhook would be readable by any player (and usable to post into your channel). The config value is only read when the convar is empty. Without either, no webhook is sent.

Without np_phone, notifications appear as console toasts (or through np_hud when the console is closed).

Rollouts ​

lua
rollouts = { enabled = true, maxTargets = 50 },

maxTargets caps the vehicles in one rollout. See Fleet.

Variables ​

lua
variables = {
  unitStateBagKey = 'vehicleUnit',
  callsignStateBagKey = 'vehicleCallsign',
  unitFromPlatePattern = '(%d+)%s*$',
},

How {unit} and {callsign} resolve per vehicle. unitFromPlatePattern is a Lua pattern; its first capture on the plate becomes the unit when nothing else sets it. See Variables.

Wear ​

lua
wear = {
  enabled = true,
  perDay = 4.0,
  damageFactor = 0.08,
  repaintThreshold = 70,
  stateBagKey = 'vehicleLiveryWear',
},

wear = min(100, days since apply × perDay + lost body health × damageFactor). At repaintThreshold the vehicle is flagged needs repaint. See Wear and repaint.

Brand kits ​

lua
brandKits = { enabled = true, maxColors = 16, maxLogos = 12 },

See Brand kits.

Photo mode ​

lua
photoMode = {
  enabled = true,
  uploadUrl = '',
  uploadField = 'files[]',
  saveToPhone = true,
},
Option Description
enabled Photo mode button in the bay camera bar (needs screenshot-basic)
uploadUrl / uploadField screenshot-basic upload target. Empty: the photo is only shown in the NUI
saveToPhone Save uploaded photos to the np_phone gallery (addPhoto). On unless set to false; needs an uploadUrl (the phone stores a URL) and np_phone started

When a photo is uploaded and saving is on, the console shows it as saving to phone; the server confirms the result with a notification (Photo saved or the reason it failed).

Editable in np_admin ​

When np_admin runs, Settings → Manufacturing edits 39 of these keys in game. shared/config.lua stays the default; np_admin stores only the overrides. See np_admin settings.

Category Fields
General enabled, locale, debug, developmentCommands
Access authorization.allowAllPlayers, authorization.requireStablePlayerIdentifier, organization.enabled, visibility.organization, allowEphemeralVehicleIdentity, allowPlateIdentityFallback
Features requireServerApproval, requireRegisteredTemplate, allowAdminUnregisteredInspection, allowPlayerUploads, allowPlayerAttachmentPlacement, enableFixtureCatalog, allowRuntimeTexturePreview, runtimeSlots.enabled, rollouts.enabled, rollouts.maxTargets
Limits maxLayers, maxAttachmentsPerBuild, maxProjectsPerOwner, maxAssetBytes
Workshop sessionTimeoutSeconds, playerComputerDistance, vehicleBayDistance
Pricing pricing.currency, pricing.wrapBase, pricing.perLayer, pricing.labourPerMinute
Production productionJobs.enabled, productionJobs.requireMaterials, productionJobs.jobTimeoutMinutes
Billing billing.enabled, billing.payer
Notifications notifications.phone, notifications.hud, notifications.discordWebhook (a secret; the convar np_manufacturing_webhook wins when set)

Most fields apply live. allowRuntimeTexturePreview, runtimeSlots.enabled and developmentCommands need a resource restart. locale, visibility.organization, rollouts.enabled, productionJobs.enabled and billing.enabled reach a client the next time its console boots. authorization.allowAllPlayers shows a warning and can only be changed by staff with np_admin.perms.manage.