Skip to content

Configuration ​

Everything has a default and the files are commented. Each feature module owns one file in shared/config/ and extends Config with its own table. Most values are also on np_admin's Resource settings → Factions page (below), and many rules can be overridden per faction in the Faction HQ or the staff editor.

File Holds
shared/config/00_core.lua Framework / inventory detection, staff fallbacks, Config.Integrations, multi-job slots and cooldown, audit retention, the salary cap Config.Faction.maxSalary
server/config/admins.lua Config.Admins, the staff list without np_admin (server-only, never downloaded; also the convar np_faction_admins)
shared/config/factions.lua Faction defaults (auto mirror), members (offers, probation, hire range), commands
shared/config/duty.lua Shift rules (AFK, zones, uniform, max length), the AFK checks, one paid shift per character, pay models, the payroll schedule, units, planner, phone / Discord parts
shared/config/bank.lua Money provider, limits, approvals and the threshold range, the boss-menu cooldown, auto rules, np_payments, migration (migrate, bankingMigrates)
shared/config/places.lua · armory.lua · locker.lua · fleet.lua Place types and budgets, limits on in-game places, loadouts, outfits, vehicles and garages, the fleet model allowlist, fuel and repair caps
shared/config/applications.lua · board.lua · phone.lua · discord.lua Recruiting (with apply / withdraw cooldowns), the board, the phone app / tablet, Discord roles (allow and block lists) and logs
shared/config/staff.lua The staff editor, the feature catalogue, discipline, what a faction's command may change, np_gangs / np_environmental / np_cctv
shared/factions/*.lua Faction files (grades, nodes, certifications, places, outfits, vehicles)
shared/templates/*.lua The four faction templates

Core ​

lua
Config.Locale = 'en'                 -- 'en' | 'de'
Config.Framework = 'auto'            -- 'esx' | 'qbx' | 'qb' | 'standalone' (auto prefers esx > qbx > qb)
Config.Inventory = 'auto'            -- 'np' | 'ox' | 'qb' | 'none'

Config.Integrations = { np_admin = 'auto', np_banking = 'auto', np_payments = 'auto', np_phone = 'auto', ... }

Config.Jobs = {
  unemployed = 'unemployed', unemployedGrade = 0,
  reconcile = true,        -- framework job changes made by others add a membership
  offlineWrites = true,    -- hire / fire / grade offline write the framework's DB row
  dutyAuthority = true,    -- np_faction decides duty and pushes it to the framework
}
Config.Faction = {
  maxSalary = 5000,        -- highest grade salary (per hour of duty); 0 / false = no cap
  ...
}
Config.Audit = { keepDays = 90 }

Config.Integrations.<name> = false forces the built-in fallback for one sibling (Integrations).

Config.Faction.maxSalary is checked on the server on every grade write: a rank save above it is refused with salary_cap, for members with ranks.edit and for staff; ladders from elsewhere (faction files, templates, imported framework grades) are clamped to it. The payroll caps the hourly rate at it again. With no cap a faction boss could mint money through the payroll.

Staff list without np_admin ​

With np_admin running its permission nodes decide (Staff editor & np_admin). Without it, a player is staff when their framework group is in Config.AdminGroups, they hold one of Config.AdminDiscordRoles (np_discord), or their identifier is in Config.Admins. That list lives in server/config/admins.lua, a server script that clients never download, and in the convar np_faction_admins (comma or space separated); both are merged:

lua
-- server/config/admins.lua
local admins = {
  'license:0123456789abcdef0123456789abcdef01234567',
}
cfg
set np_faction_admins "license:0123456789abcdef0123456789abcdef01234567,discord:123456789012345678"

Config.Admins set in a shared config file (older installs) still counts but reaches every client: move it.

Factions ​

A faction is built from three layers, later wins per key: the template of its type (shared/templates/<type>.lua), the faction file (shared/factions/<id>.lua) and the editor's database row. Reset to file in the staff editor drops the database row.

Type Template Typical
government Eight grades from recruit to chief, the top two are bosses Police, sheriff, EMS, fire, DOJ
business A short ladder, the owner is boss Mechanic, restaurants, taxi, dealers
organisation Not on the jobs board, may be hidden Mafia, cartels, crews
club Memberships next to the job Gun club, racing team, the press
Link mode What happens
mirror Uses an existing framework job. The framework's grade list, names and labels stay authoritative; np_faction overlays nodes, salary and boss per grade (file grades matched by name, then by number)
create np_faction writes its ladder into the framework (ESX jobs / job_grades, qbx / qb shared jobs) when it is missing or drifted. On ESX the job is whitelisted (not offered by esx_joblisting) unless the faction sets settings.publicJob = true
none Never a framework job: clubs, unions, organisations. Does not use a multi-job slot
lua
Config.Factions = {
  autoMirror = true,       -- every framework job without a faction file becomes a mirror faction
  governmentJobs = { 'police', 'sheriff', 'ambulance', 'ems', 'fire', 'doj', ... },  -- these get the government template
  ignoreJobs = { 'unemployed' },
  autoStyle = { police = { icon = 'shield-halved', tint = 'blue' }, mechanic = { icon = 'wrench', tint = 'rust' }, ... },
}

A faction file, shortened from the shipped shared/factions/police.lua:

lua
NpFaction.faction({
  id = 'police', label = 'Los Santos Police Dept.', short = 'LSPD',
  type = 'government', tint = 'blue', icon = 'shield-halved', link = 'mirror',
  grades = {
    [0] = { name = 'recruit', label = 'Cadet', salary = 120, nodes = cadet },
    [4] = { name = 'sergeant', label = 'Sergeant I', salary = 215, nodes = sergeant },
    [6] = { name = 'captain', label = 'Captain', salary = 280, boss = true, nodes = captain },
    [7] = { name = 'chief', label = 'Chief of Police', salary = 340, boss = true, nodes = { ['*'] = true } },
  },
  certs = {
    k9 = { label = 'K9', icon = 'dog', nodes = NpFaction.nodes({ 'assets.garage.k9' }) },
    air1 = { label = 'Air-1', icon = 'helicopter', nodes = NpFaction.nodes({ 'assets.garage.air', 'places.helipad' }) },
  },
  settings = { probationDays = 14 },
})

A faction file may also carry places, armory, outfits and fleet tables in the same shape as the config lists below. Salaries are np_faction's hourly grade rate (the pay models use them).

Permission nodes ​

Nodes are dotted; members.* and * grant everything below. A node may carry a limit ({ limit = 5000 }), returned as the second value of Can. A member on probation keeps only Config.Members.probationNodes; a suspended member holds none.

Group Nodes
Faction boss, ranks.edit, settings.edit, audit.view
Members members.view, members.hire (limit = highest grade), members.fire, members.promote (up to their own grade − 1), members.notes, members.status, members.callsign, members.discipline, certs.grant, applications.review
Duty duty.clock, duty.view, duty.manage
Bank bank.view, bank.deposit, bank.withdraw (limit = daily budget), bank.spend (limit = daily cap), bank.manage, bank.payroll, bank.approve, bank.invoice, payments.bill, payments.manage
Assets assets.locker, assets.uniforms, clothing.uniform, assets.armory, assets.stash, assets.evidence, assets.garage, assets.garage.<class>, places.manage, fleet.manage, fleet.takehome, armory.manage
Comms board.read, board.post, board.pin, board.delete, comms.radio, comms.radio.cmd

Other resources add their own nodes to the editor's catalogue with registerNode (np_cctv's cctv.manage, np_metal-scanner's metal-scanner.manage).

Members and multi-job ​

lua
Config.MultiJob = {
  slots = 3,               -- framework-linked factions a character may hold
  switchCooldown = 300,    -- seconds between two switches of the active job
  clubsUnlimited = true,   -- link 'none' factions do not use a slot
  blockOnDuty = true,      -- no switch while on duty
  autoOffDuty = false,     -- true: switching clocks out instead of refusing
}
Config.Members = {
  hireRange = 5.0, hireNeedsNearby = false,
  hireOffer = false, offerSeconds = 120,   -- true: a hire is an offer the target accepts
  probationNodes = { 'duty.clock', 'comms.radio', 'members.view', 'board.read', 'assets.locker', ... },
  externalUnemployedFires = true,
  notesKept = 20,
}
Config.Commands = { hq = 'faction', duty = 'jobduty' }

The faction feature Multi-job (staff editor) off makes a faction one that is held alone.

Duty and pay ​

lua
Config.Duty.defaults = {
  payModel = 'hourly',     -- 'hourly' | 'salary' | 'task' | 'mix' (hourly + tasks)
  paySource = 'faction',   -- 'faction' = the faction's payroll account | 'server' = framework money
  afk = true, afkMinutes = 5, afkOff = true, afkOffMinutes = 15,
  zoneOnly = false, zoneOff = false, zoneGrace = 2,
  uniform = false,         -- clock in only in the faction's uniform (np_clothing)
  maxHours = 0,
  quota = 10,              -- weekly hours
  goalUnits = 4, goalFrom = 18, goalTo = 2,   -- coverage goal: 4 units from 18:00 to 02:00
  salaryHours = 10, salaryMinHours = 1,
}
Config.Duty.payroll = { enabled = true, schedule = 'weekly', weekday = 5, time = '18:00', minutes = 60, serverFallback = false }

Config.Duty.moveMeters = 2.0         -- moving this far between two checks counts as activity (read on the server)
Config.Duty.turnDegrees = 20         -- turning the ped this far counts as activity (read on the server)
Config.Duty.afkVerify = true         -- with OneSync the client's input report only counts for a while (below)
Config.Duty.afkClaimMinutes = 30     -- reported input (keys, mouse, camera) while the ped stands still
Config.Duty.afkUiMinutes = 20        -- working in a focused np_faction screen (HQ, tablet) while the ped stands still
Config.Duty.singlePaidShift = true   -- on duty in two factions at once: only one shift is paid at a time
Config.Duty.planMax = 100            -- shift planner: most upcoming planned shifts per faction
Pay model Paid
hourly Clocked hours minus AFK time × the grade's rate (fixed at shift start)
salary Rate × salaryHours once per payroll, for members who clocked at least salaryMinHours
task Tasks other resources credit with PayTask
mix Hourly plus tasks

Every rule is overridden per faction by its settings duty<Rule> (dutyPayModel, dutyAfkMinutes, dutyZoneOnly, dutyQuota …), set in the HQ Duty tab. Duty zones are the faction's duty places plus Config.Duty.zones. Units (Config.Duty.units: patrol, traffic, K9, Air-1 …) may need a certification. The payroll timer survives restarts; a missed run happens at the next start.

  • AFK. The client's heartbeat is only a claim. With OneSync the server watches the ped itself: reported input counts for afkClaimMinutes and work in an np_faction screen for afkUiMinutes after the last movement or turn the server saw (0 = no limit). afkVerify = false trusts the client, as without OneSync.
  • One paid shift. With singlePaidShift a character on duty in two factions is paid for the first shift only; the other counts from when the first one ends. Paid time never exceeds the wall-clock time the shifts span.
  • Who pays. Wages come from the faction's payroll account. paySource = 'server' (framework money, created) can only be set by staff with np_faction.finance (code pay_source_staff). payroll.serverFallback pays every faction from framework money while no money module runs; it is off by default, so wages stay owed until one runs. With phone.island the shift runs as a Live Activity on np_phone, with discord.enabled clock-in and clock-out go to the np_discord channel np_faction_duty.

Framework paychecks

es_extended pays Config.PaycheckInterval from its own config, qbx_core and qb-core their own paycheck. np_faction cannot switch those off from outside: turn off one of the two systems.

Bank ​

lua
Config.Bank = {
  provider = 'auto',       -- np_banking while it runs, else the internal ledger; 'np_banking' | 'ledger' force one
  moveLedger = true,       -- move ledger balances into np_banking once it appears
  accountType = { government = 'faction', default = 'business' },
  maxAccounts = 6, maxAmount = 10000000,
  withdrawTo = 'bank', depositFrom = 'cash',
  approvals = { threshold = 25000, signatures = 2, expireMinutes = 1440, notifyPhone = true,
    minThreshold = 1000, maxThreshold = 100000 },   -- the range a faction's bank.manage holder may set
  playerCooldownMs = 1000, -- BankWithdraw / BankDeposit (compat shims, other boss menus): one move per player per this many ms
  rules = {
    payroll = true,        -- salaries from the payroll account
    invoicePercent = 20,   -- share of an np_payments invoice the faction keeps, the rest to the issuing member
    upkeep = 0, topUp = true, topUpTo = 2,
    govShare = 0, govGrant = 0, cityFaction = nil,
  },
  invoiceDays = 3, terminals = true,
  migrate = 'ask',         -- 'off' | 'ask' (staff click Migrate) | 'auto' (once per faction at start)
  migrateZero = true,
  bankingMigrates = false, -- true: np_banking imports the ESX societies itself, skip that source here
}

With np_banking the operating account is np_banking's society account of the faction's job, so exports.np_banking:GetSocietyAccount(job), np_payments' payee { type = 'society', id = job } and np_faction's own exports all reach the same money (np_banking → Job accounts). Extra accounts (payroll, evidence, budgets) are np_banking accounts of type faction (government) or business. The rules are the defaults; each faction switches them in the HQ Bank tab. payroll (off = salaries from server money) and govGrant can create money, so only staff (np_faction.finance) change those per faction; bank.manage holders set the rest. A two-signature threshold of 0 or outside approvals.minThreshold .. maxThreshold is staff only too (code staff_only). Money moves a player triggers outside the HQ go through BankWithdraw / BankDeposit with the same budget, signatures and hooks. The migration of old society money and the double-import note are on Installation.

Places, armory, lockers, fleet ​

lua
Config.Places = {
  bossBudget = 16,                                       -- places a faction's bosses may place (setting placesBudget)
  bossTypes = { 'duty', 'locker', 'stash', 'garage', 'boss' },  -- everything else is staff only
  placeRange = 25.0, useRange = 2.0, blips = 'members',  -- 'members' | 'duty' | 'all' | false
  stash = { slots = 50, maxWeight = 100000 }, evidence = { slots = 120, maxWeight = 400000 },
  locker = { slots = 20, maxWeight = 40000 },
  maxStash = { slots = 200, maxWeight = 1000000 },       -- largest stash a boss may set in game
  spawnRange = 60.0,                                     -- garage / helipad spawn points this close to their place
  extraBytes = 2048,                                     -- largest data.extra (JSON) of a registered place type
  npcModels = { 's_m_y_cop_01', 's_f_y_cop_01', 's_m_m_paramedic_01', ... },  -- clerk models bosses may pick (empty = any)
  list = { police = { { key = 'mrpd_duty', type = 'duty', label = 'Front desk', station = 'Mission Row PD',
    coords = { x = 441.1, y = -981.9, z = 30.69 }, radius = 1.5, blip = 'all' }, ... } },
}
Config.Armory = { requireDuty = true, returnOnClockOut = true, serials = true, keepDays = 30, loadouts = { police = { ... } } }
Config.Locker = { useNpClothing = true, personal = true, outfits = { police = { ... } } }
Config.Fleet = {
  requireDuty = true, maxOutPerMember = 2, platePrefix = { police = 'LSPD', ambulance = 'EMS' },
  classes = { patrol = { label = 'Patrol', icon = 'car-side' }, air = { label = 'Air', icon = 'helicopter', type = 'heli', place = 'helipad' }, ... },
  takeHome = { enabled = true, minGrade = 2, perMember = 1, returnOnDemotion = true },
  models = { ['*'] = {}, police = { 'police', 'police2', 'police3', 'policeb', 'polmav', ... }, ambulance = { 'ambulance', 'lguard' } },
  fuelBilling = true, refundDriver = true, fuelRange = 25.0,
  repairs = { billed = true, perPoint = 1.5, maxPerStore = 1500, maxPerDay = 10000 }, impoundFee = 250,
  vehicles = { police = { { key = 'lspd_014', model = 'police', label = 'Stanier Interceptor', class = 'patrol', plate = 'LSPD 014' }, ... } },
}
  • Places come from the config list, a faction file's places and the in-game placement tool. A place carries rules = { minGrade?, node?, cert?, duty? }, can be shared with other factions (factions = { 'police' }) and can have a clerk (npc, np_npchandler) or a door (door, np_prophandler). Other resources add types with registerPlaceType. Places a boss sets in game are limited: stash sizes up to maxStash, spawn points within spawnRange, clerk models from npcModels, a registered type's extra data up to extraBytes (staff and config places: up to 1000 slots / 10,000,000 weight and any valid model). Stashes never get a public blip.
  • Armory loadouts per grade or certification with a maximum per item; serial items get metadata.serial (LSPD-0412) and clock-out takes issues back (what is missing stays logged).
  • Lockers use np_clothing's own faction locker when it runs, else the built-in outfit list (np_clothing applyOutfit or skinchanger on ESX). personal gives every character a locker stash.
  • Fleet vehicles are seeded once per key, then edited in the HQ. The vehicle's class node (assets.garage.<class>) with its limit caps the vehicles out per member. Models must be on the allowlist Config.Fleet.models (keys: a faction id, a faction type or '*'), checked when a vehicle is added or changed and again at take-out. Always allowed on top: the seeded models, a faction file's fleetModels and the faction setting fleetModels (comma-separated, set by staff in the editor). Staff may add any model; a boss gets fleet_model_forbidden. Members store only vehicles they hold (holders of fleet.manage: any of the faction), never one somebody else drives.
  • Fuel and repairs. Fuel bought at np_fuel pumps is billed to the faction and refunded to the driver when the payer stands within fuelRange of the vehicle. Storing a damaged vehicle repairs it at perPoint per health point, at most maxPerStore per bill and maxPerDay per member and 24 h; above that the vehicle is stored damaged (0 = no cap).

Applications and the board ​

lua
Config.Applications = {
  modes = { government = 'whitelist', business = 'open', organisation = 'closed', club = 'whitelist' },
  openVia = { phone = true, jobCentre = true },
  maxOpen = 3, reapplyDays = 7, blockOnFailedRequirements = true,
  applyCooldown = 300,     -- seconds between two applications of one character to the same faction
  withdrawCooldown = 3600, -- seconds after a withdrawal before applying there again
  formVersionsKept = 10,   -- old form versions kept per faction (versions open applications answer stay)
  requirements = { government = { playtime = 20, licences = { 'driver_license' }, noWarrants = true, minAge = 18 }, ... },
  rules = { police = { grade = 5, votes = 3, voteGrade = 4 } },   -- Lt+ hires alone, else 3 Sgt+ votes
  trialSteps = 3,
  interview = { times = { '17:00', '18:00', '19:00', ... }, days = 3, slots = 6, minutes = 30, reminder = 15 },
  jobCentre = { enabled = true, coords = { x = -265.36, y = -963.6, z = 31.22, w = 205.0 }, model = 'a_f_y_business_02' },
  forms = { government = { { id = 'why', type = 'long', label = 'Why do you want to join?', required = true }, ... } },
}
Config.Board = { auto = { hired = true, promoted = true, fired = false }, maxPinned = 5, maxExpiryDays = 60, keepPosts = 200 }

open factions hire on the spot (phone or job centre), whitelist factions run the pipeline (new, interview, trial, decision), closed ones are not on the jobs board. Requirements: playtime from np_admin, licences from np_identification, minimum age from np_character, warrants through the applicationCheck hook of your MDT. Question types: text, long, choice, multi, availability. Every form edit is a new version.

Phone app ​

lua
Config.Phone = {
  app = { id = 'faction', name = 'Faction', icon = 'fa-solid fa-people-group', tint = 'blue', default = true },
  badges = true,
  tablet = { command = 'factionapp', key = '', item = 'faction_tablet', always = false },
}

default = true puts the app on every phone; false lets players install it from the App Store. The tablet opens the same pages without np_phone (or always, with always = true).

Discord ​

lua
Config.Discord = {
  sync = true, removeOld = true,
  factions = { -- police = { grades = { [6] = 'Captain' }, duty = 'On duty LSPD', log = 'lspd', allowed = { 'LSPD Officer' } },
  },
  allowedRoles = {},       -- roles the faction settings may map (plus factions.<id>.allowed); empty = none
  blockedRoles = {},       -- never granted: put np_admin's staff roles here
  log = { channel = 'np_faction', hires = true, fires = true, grades = true, applications = true },
}

np_discord's own Config.JobRoles already gives a role per job, for every job a player holds. Use this table only for grade and on-duty roles and the log channels. Per faction the settings discordGrade<n>, discordDuty and discordLog override it, but a role from the settings is only mapped when it is on allowedRoles or factions.<id>.allowed (others are refused on save and ignored). The file's own maps (factions.<id>.grades / duty) are allowed as they are. Roles on blockedRoles and Config.AdminDiscordRoles are never granted, whatever a map says.

Staff, features, discipline ​

lua
Config.Staff = {
  command = 'factionadmin',
  features = { { id = 'duty', ... }, { id = 'multijob', ... }, { id = 'applications', ... }, { id = 'armory', ... },
    { id = 'fleet', ... }, { id = 'billing', ... }, { id = 'board', ... }, { id = 'discord', ... } },
  accountPurposes = { 'operating', 'payroll', 'evidence', 'parts', 'budget' },
}
Config.Discipline = { verbalDays = 30, writtenDays = 90, maxSuspensionDays = 30, notifyTarget = true }
Config.HqSettings = {
  identity = { short = true, tint = true, icon = true, label = false },
  features = { 'applications', 'board', 'billing', 'discord' },   -- what a boss may switch
  numbers = { probationDays = { min = 0, max = 60 }, quota = { min = 0, max = 80 } },
  hiring = true,
}
Config.Gangs = { blockTypes = { 'government' }, blockFactions = {} }         -- np_gangs: may not found a gang
Config.Environmental = { needsDuty = true, factions = { police = { key = 'police', service = '911' }, ... } }
Config.Cctv = { factions = { police = { minGrade = 0, kind = 'pd' } } }

Each faction switches its features (duty clock, multi-job, applications, armory, fleet, billing, board, Discord) in the staff editor; a boss may switch the ones in Config.HqSettings.features in the HQ Settings tab.

Editable in np_admin ​

With np_admin running, Resource settings → Factions shows one page with a category per module: General, Jobs, Factions, Applications, Armory, Bank, Board, Discord, Duty and payroll, Fleet, Lockers, Phone app, Places, Staff. np_admin stores only the overrides and writes them back into Config. Each field says when a change applies: live, at a player's next load, or after a restart.

Not on the page on purpose (edit the files or use the staff editor): faction records, grades, nodes, certifications, places, the fleet, and the staff fallback lists (Config.Admins in server/config/admins.lua, AdminGroups, AdminDiscordRoles), which only count while np_admin is not running. More on Staff editor & np_admin.