Integrations ​
np_faction works in both directions. It calls a set of np_* resources when they run, each with a built-in fallback
(below). And many np_* resources honour np_faction through a small adapter of their own: while
np_faction is started they ask it for jobs, duty, permission nodes and faction money, so multi-job and the faction bank
work everywhere (below). Nothing depends on np_faction: every adapter checks
GetResourceState('np_faction') == 'started' at call time and falls back to the framework.
What np_faction uses ​
Only oxmysql is required. Every sibling has one file in integrations/ that declares the exports and events it uses and
wraps them behind a function with a fallback. At start (and whenever a sibling starts or stops) the console prints one
line per sibling: active, fallback (…), missing export <name> or no adapter. Config.Integrations.<name> = false
forces the fallback. A test (tests/test_integrations.lua) checks every declared export and event against the
sibling's source next to the repo.
| Sibling | With it | Without it |
|---|---|---|
| np_admin | Staff permission nodes, the settings page Factions, staff tools, the audit log, the server theme (Staff editor & np_admin) | Config.Admins, framework admin groups, np_discord roles; no settings page |
| np_banking | Faction accounts: the operating account is the job's society account (GetSocietyAccount), extra accounts per purpose (CreateAccount, GetJobAccounts), charges, credits, transfers, freezes |
np_faction's own ledger; balances move into np_banking once it runs |
| np_payments | Invoices and fines in the faction's name (Invoice, payee { type = 'society', id = job }), a terminal per faction (RegisterTerminal), the invoice share on np_payments:paid |
No faction invoices (feature_off) |
| np_phone | The Faction app in the App Store with its RPCs, notifications, badges, the shift Live Activity in the Dynamic Island (with an off duty button), shift and interview invites in the calendar, mail for application decisions, the duty switch of np_phone's Jobs app | The Faction tablet, toasts instead of notifications, no island or calendar |
| np_hud | Toasts, prompts and progress bars | np_faction's own NUI layer draws them |
| np_menu | Radial entries and context options | Commands and prompts |
| np_inventory | Armory, faction stashes, evidence and personal lockers (RegisterStash without coords, so no public blips; open hook with np_faction's rules), the faction_tablet item, serial metadata |
ox_inventory / qb-inventory through the inventory bridge, or no stashes |
| np_clothing | Its faction locker (openLocker), uniforms, applyOutfit / storeOutfit, the uniform duty rule (getUniform) |
The built-in locker with skinchanger on ESX; the uniform rule checks the built-in outfit |
| np_character | Character id and name, job spawns at the faction's spawn or duty places (registerSpawnProvider), minimum age for applications |
Framework identifiers and names, no job spawns |
| np_identification | Licences as application requirements (hasValidDocument), badges and state id on the roster |
Licence requirements are skipped |
| np_discord | Grade and on-duty roles (AddRole / RemoveRole; roles from faction settings only from Config.Discord.allowedRoles, never blockedRoles), log channels for hires, departures, promotions, applications and the duty log, staff by Discord role |
No roles, no Discord logs |
| np_gangs | Its eligibility hook: members of government factions (Config.Gangs) may not found a gang at Lester's |
– |
| np_environmental | Factions registered as responders (RegisterFaction, 311 / 911), re-registered when either restarts |
– |
| np_cctv | One camera network per listed faction (registerNetwork, key npf_<id>): members watch, bosses manage |
– |
| np_npchandler | The job centre clerk and place clerks (registerNpc) |
A prompt at the same spot |
| np_prophandler | Door places (registerDoor, setDoorLocked after np_faction's rules) |
No door places |
| np_fuel | Fleet fuel at spawn and store (SetFuel / GetFuel), pump purchases for a fleet plate billed to the faction and refunded to the driver when they stand within Config.Fleet.fuelRange of the vehicle (np_fuel:server:refueled) |
The fuel state bag, no fuel billing |
| np_minigames | Reserved: np_faction ships no minigame of its own, and any it adds goes through np_minigames | – |
np_doors reads np_faction itself: its job rules check every job of a player (HasJob with grade and duty)
and police on duty come from GetOnDuty (np_doors integrations). np_faction's own door
places still go through np_prophandler.
np_shops, np_mechanic and np_prison are on the list without an np_faction-side adapter; they honour np_faction through
their own (below).
Resources that honour np_faction ​
Each of these ships an np_faction adapter (usually integrations/np_faction.lua, with a Config.Integrations.np_faction
or Config.UseNpFaction toggle, often also in np_admin's settings). They are inert while np_faction is stopped.
| Resource | What it does with np_faction |
|---|---|
| np_banking | The active job from GetJob; job account roles follow np_faction's nodes (bank.manage → owner, bank.spend → spend, other members view); a character sees the accounts of every job they hold; police on duty from GetOnDuty; several accounts per job (GetJobAccounts), job accounts without a member cap |
| np_payments | Jobs, groups and on-duty lists across every held job; boss checks via node boss or payments.manage; terminal access, the phone's boss page and the approval queue look at every job |
| np_phone | Hosts the Faction app; its Jobs app duty switch reaches np_faction (np_phone:jobs:setDuty) |
| np_hud | The job chip shows np_faction's active job (label, grade) and a duty dot, from the npFaction state bag |
| np_menu | Bridge getJob / hasGroup over every held job; the F1 duty switch fires np_faction:toggleDuty |
| np_admin | Player list and detail show every held job; Set job goes through np_faction's SetJob (clubs, multi-job) |
| np_discord | Config.JobRoles gives the roles of every held job (GetJobs), resynced on np_faction:jobChanged |
| np_passwords | Job-owned locks for any held job, the boss shortcut via node boss, one job vault per held job, warrant reads |
| np_inventory | Group checks over every held job, police on duty, the client's group check from the state bag |
| np_clothing | Faction membership for its lockers over every held job, uniform leaders via boss or clothing.uniform, duty through SetDuty |
| np_identification | Police, issuer and badge checks over every held job with duty per job; the designer's issuer list includes np_faction's factions |
| np_character | Appearance job unlocks for every held job, in the creator too |
| np_tattoos | Job crews and moderation over every held job; the shop share is credited to the faction account |
| np_drugs | Job checks and on-duty police counts over every held job |
| np_gangs | Lester refuses anybody holding a blocked job in any slot; corner police alerts reach everyone on duty in any job |
| np_cctv | Job networks over every held job; managers via the network's grade or node cctv.manage |
| np_surveillance | Access roles from every held job, on duty per job |
| np_cellnet | Telecom checks over every held job; tower upgrades need node boss and are paid from the telecom faction account; optional repair pay from it |
| np_screens | Job rules, cinema staff and channel gates pass when any held job passes |
| np_spy-pigeon | Loft access jobs match any held job |
| np_helicam | Air, ground and BOLO roles over every held job, callsigns from np_faction |
| np_flightradar | Access rules (radar jobs, station jobs, the phone job) met by any held job |
| np_mechanic | Workshop staff and police over every held job; society money through the faction account |
| np_shops | Job checks and duty lists over every held job; society money through the faction account; pay company from a faction account with bank.spend |
| np_vending | One operator per held job, owners via node boss; society money through the faction account |
| np_prison | Guard, police, judge, lawyer and parole checks over every held job, on-duty lists |
| np_fuel | Station society money through the faction account; any held job or node bank.manage controls a station's job account |
| np_farming | Farmer, police and contract checks over every held job, on duty |
| np_fishing | Rangers and restaurant orders over every held job |
| np_environmental | Its responder factions from every held job with duty per job; society pay through the faction account |
| np_metal-scanner | Shifts clock in and out through SetDuty; venue managers via node metal-scanner.manage |
| np_npchandler / np_prophandler | Job conditions of NPCs, props and doors accept any held job |
| np_billiards / np_darts / np_golf | Bar and pub owners and the caddie job over every held job; optional bar account and pub withdrawals through the faction account |
| np_manufacturing | Organization membership over every held job; organization charges and refunds through the faction account; reads the fleet's vehicleOrganizationId |
| np_minigames | No adapter needed: np_faction itself only plays games through it |
Writing your own adapter ​
local function npf() return GetResourceState('np_faction') == 'started' end
local origGetJob = Framework.getJob
Framework.getJob = function(src, ...)
if npf() then
local ok, job = pcall(function() return exports.np_faction:GetJob(src) end)
if ok and job then return job end
end
return origGetJob(src, ...)
end
-- multi-job: any held job counts (minimum grade per job, on duty in that job)
local function isPolice(src)
if npf() then
local ok, yes = pcall(function() return exports.np_faction:HasJob(src, { police = 0, sheriff = 0 }, nil, true) end)
if ok then return yes end
end
return legacyIsPolice(src)
end
-- refresh cached job data
AddEventHandler('np_faction:jobChanged', function(src) refresh(src) end)
AddEventHandler('np_faction:dutyChanged', function(src) refresh(src) end)
The job shape carries both key spellings (isBoss / isboss, onduty / onDuty), so most code that reads a
framework job reads np_faction's unchanged. Society money: GetBalance / AddMoney / RemoveMoney(job, …) before the
legacy path for server-side moves; a withdrawal or deposit a player clicks (a boss menu) goes through
BankWithdraw / BankDeposit(src, job, …), so the faction's budgets, signatures and cooldown apply. All of it is on Exports & hooks and Events & state bags.