Bridges ​
np_tattoos talks to frameworks only through NpTat.Framework and to inventories through NpTat.Inventory. Each bridge
file calls NpTat.Bridge.shouldLoad(kind, name, resource) and returns early unless its resource is started and
selected (Config.Framework / Config.Inventory, or 'auto'). Files are numbered, so auto tries qbx_core →
qb-core → es_extended → standalone and ox → qb → esx → none. Detection runs once at start, so start the framework
and inventory before np_tattoos.
Every bridge call goes through pcall, so a missing export or a failing call degrades instead of erroring.
Server framework contract ​
bridge/framework/server/. qb and qbx share one implementation (qbFamily) because their Player API is the same.
| Contract | Used for |
|---|---|
getCid(src) |
The loaded character. Ink is stored per character id |
getName(src) |
Submitter and staff names, the /marks title |
getGender(src) |
Which hash to use when the client hasn't reported a freemode model |
getJob(src) / getGang(src) |
Crew designs, submitters, /marks |
isJailed(src) |
Prison ink |
getMoney / removeMoney / addMoney |
Parlour prices and refunds (cash / bank) |
addSociety(society, amount) |
Shop money to a society account |
What each bridge does ​
| Contract | qbx (qbx_core) |
qb (qb-core) |
esx (es_extended) |
standalone |
|---|---|---|---|---|
| cid | citizenid |
citizenid |
xPlayer.identifier |
np_character's active character, else the license |
| gender | charinfo.gender |
same | sex |
np_character's character, else male |
| job / gang | PlayerData.job / .gang (grade.level) |
same | the job; gang = job | np_admin permission nodes np_tattoos.job.<name>[.<grade>] / np_tattoos.gang.<name>[.<grade>] (Permissions) |
| jailed | metadata.injail > 0 |
same | jailed / jail / jailTime state bag or xPlayer variable |
never |
| money | Player.Functions.AddMoney / RemoveMoney |
same | addAccountMoney / removeAccountMoney (cash = ESX money) |
no economy: shows Config.StandaloneMoney, every payment succeeds |
| society | Renewed-Banking, qb-banking, qb-management | qb-banking, qb-management, Renewed-Banking | esx_addonaccount (society_<name>) |
none |
| events | QBCore:Server:PlayerLoaded, OnPlayerUnload, qbx_core:server:playerLoggedOut, OnJobUpdate, OnGangUpdate, qbx_core:server:onGroupUpdate |
QBCore:Server:PlayerLoaded, OnPlayerUnload, OnJobUpdate, OnGangUpdate |
esx:playerLoaded, esx:playerLogout, esx:setJob |
np_character's events |
Money removals check the balance first and only accept cash or bank. On every framework, np_character's server
events np_character:loaded / :unloaded load and forget the ink too.
Society money ​
Set society on a shop to send the parlour's takings (purchases, laser sessions, cover-ups) to an account:
{ id = 'vinewood', label = 'Blazing Tattoo', …, society = 'tattoo' }
The bridge tries the banking resources in the order above and stops at the first that takes it. If none is running,
the money is simply not paid out (with Config.Debug, a debug line says so). When the charge went through
np_payments, np_payments credits the society through its own banking bridge instead. This
is the way to use np_banking: np_tattoos' own bridge doesn't know it, np_payments credits np_banking's
job account.
Inventory contract ​
bridge/inventory/server/:
| Contract | Description |
|---|---|
count(src, item) |
How many the player carries |
remove(src, item, n?) |
Removes n (default 1), all or nothing |
registerUsable(item, cb) |
The item triggers cb(src). Items are never auto-consumed; np_tattoos removes them once the use did something |
| Bridge | Detected by | Usable items |
|---|---|---|
ox |
ox_inventory, or np_inventory (ox compatibility layer) |
A server export per item: server = { export = 'np_tattoos.<item>' } (Installation) |
qb |
qb-inventory, ps-inventory or lj-inventory with qb-core |
QBCore.Functions.CreateUseableItem |
esx |
es_extended |
ESX.RegisterUsableItem |
none |
fallback | No items: no ointment, no henna kit, prison ink only without kits |
Client side ​
bridge/framework/client/ forwards the framework's "player loaded / unloaded" events to np_tattoos and defines
isDead(). The parlour closes and items refuse while the player is dead.
| qbx | qb | esx | standalone | |
|---|---|---|---|---|
| loaded | QBCore:Client:OnPlayerLoaded, qbx_core:client:playerLoaded |
QBCore:Client:OnPlayerLoaded |
esx:playerLoaded |
first playerSpawned, np_character events |
| unloaded | QBCore:Client:OnPlayerUnload, qbx_core:client:playerLoggedOut |
QBCore:Client:OnPlayerUnload |
esx:onPlayerLogout |
np_character events |
| dead | metadata.isdead / inlaststand, or a dead ped |
same | esx:onPlayerDeath / esx:onPlayerSpawn, or a dead ped |
a dead ped |
Tables ​
np_tattoos' own tables (sql/np_tattoos.sql, created at start with Config.AutoCreateTables):
| Table | Holds |
|---|---|
np_tattoos_ink |
One row per piece: cid, design name, a snapshot of label, zone, collection, hash_male, hash_female, then variant, opacity, kind, state, applied_at, heals_at, ointment, swam, expires_at, artist, shop, crew / flagged / removal (JSON), covered_from, glyph, image |
np_tattoos_designs |
Custom design submissions: the design fields, status (pending, approved, rejected), disabled, submitter, reviewer, reason |
np_tattoos_audit |
The moderation audit trail: at, actor, action, target, detail |
All timestamps are unix seconds. np_tattoos reads or writes no framework tables.