Skip to content

Installation ​

Requirements ​

  • np_medic with host addon API 1. The manifest declares np_addon 'np_medic', not a dependency: np_medic may restart without taking the camps down, but nothing can be placed while it is missing (no_medic).
  • np_prophandler. Without it nothing can be placed (no_handler); parts register again on np_prophandler:ready.

Optional, detected at runtime:

Kind Resources Without it
Doors np_doors Tent doors use np_prophandler doors (registerDoor with job access)
Job features np_jobs Permissions come from np_medic's fallback jobs (below)
Faction names np_faction The faction id is used as its label; door access uses the framework job
Database oxmysql Only needed for Config.Templates.store = "oxmysql"; otherwise labels and templates live in resource KVP
Framework es_extended, qbx_core, qb-core No framework job, so no faction without np_jobs
Inventory np_inventory, ox_inventory, qb-inventory (or the ESX inventory) Parts with an item gate cannot be placed; AED posts cannot hand out medic_aed

Start order ​

cfg
ensure np_prophandler
ensure np_doors            # optional
ensure np_jobs             # optional
ensure np_faction          # optional
ensure np_medic
ensure np_medic_field

np_medic_field attaches to np_medic whenever np_medic is ready (npAddon.attach('np_medic', fn, { api = 1 })), and again after every np_medic restart, so the order is not critical. Starting it after np_medic is the clean way.

Keep the folder name np_medic_field: the tablet calls https://np_medic_field/<name>, and other resources call exports.np_medic_field.

The models are streamed from stream/ and requested in the manifest. np_medic's IV pole and oxygen trolley treatment props (fluids, transfusion, oxygen) use two of these models, so they only show while np_medic_field runs (np_medic → Integrations).

Permissions ​

Give jobs the two features in np_jobs:

Feature Duty Lets a player
medic.deploy required Place and pack parts (/feld <part>), deploy templates, change a tent's label
medic.fieldplan optional Create, edit and delete the faction's labels and templates (leadership)

The addon registers both in np_jobs' medic pack, which np_medic owns. If np_medic has not registered the pack yet, it retries every 5 seconds (up to 12 times) and again whenever np_medic or np_jobs attaches. The feature ids can be changed with Config.Field.feature and Config.Field.planFeature.

lua
-- np_jobs job definition (example)
ems = { faction = 'ems', features = {
  'medic.firstaid', 'medic.treat', 'medic.stretcher',
  'medic.deploy',      -- field camp
  'medic.fieldplan',   -- give this to leadership grades
} }

Without np_jobs, add both features to np_medic's config/fallback_jobs.lua (keyed by job name, then feature id):

lua
return {
  ambulance = {
    ['medic.deploy'] = { minGrade = 0 },
    ['medic.fieldplan'] = { minGrade = 3, duty = 'never' },
  },
}

In the fallback map, a feature needs the player on duty unless its entry says duty = 'never'.

Database (optional) ​

Labels and templates are stored per faction. The default store is resource KVP (Config.Templates.store = "kvp") and needs no database. With store = "oxmysql", run sql/install.sql:

sql
CREATE TABLE IF NOT EXISTS np_medic_field_store (
  kind VARCHAR(16) NOT NULL,          -- 'labels' | 'templates'
  faction VARCHAR(64) NOT NULL,
  data LONGTEXT NOT NULL,             -- JSON { seq, list = { ["<n>"] = ... } }
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (kind, faction)
);

If oxmysql is configured but not running, the store falls back to KVP and prints a warning.

Items ​

  • medic_aed: the AED handed out by AED posts (Config.Field.aedItem). np_medic defines it in its config/medic/items.lua; on ox_inventory or qb-inventory, add it there too.
  • A part can require an item to be placed (item in Config.Field.items). The item is checked, not consumed. No part requires one by default.

Escrow ​

The manifest keeps config/*.lua, bridge/*.lua, server/bridge.lua and server/store.lua out of escrow, so the configuration, the framework / inventory bridge and the storage stay editable.