Pharmacy job
Add the pharmacy job to QBCore, Qbox, ESX, or Kora and point each pharmacy at it.
A pharmacy with a job set is player-run. Its job name has to match a real job in your framework. The sample name is pharmacy. Never leave a placeholder like police in there.
Merge the file for your framework, restart the framework core, then restart this resource. The files live in [INSTALL]/jobs/.
| Framework | File | Where it goes |
|---|---|---|
| Qbox | qbx_core.txt | Merge into qbx_core/shared/jobs.lua |
| QBCore | qb-core.txt | Merge into qb-core/shared/jobs.lua |
| ESX Legacy | esx.sql | Run once against your database |
| Kora | kora_core.txt | Merge into the KoraCoreSeed.jobs table in kora_core/shared/jobs.lua |
The sample job has four grades: Clerk, Pharmacist, Senior Pharmacist, and Manager. The manager grade is the boss, with bank access, so the boss menu works without extra setup.
Kora format
Kora jobs are records in a list, not a table keyed by job name. Each record carries its own name, and grades is an array where the first entry is grade 1. Add this record inside KoraCoreSeed.jobs in kora_core/shared/jobs.lua:
{
name = 'pharmacy', label = 'Pharmacy', defaultDuty = true, offDutyPay = false, type = 'none',
grades = {
{ name = 'Clerk', payment = 50 },
{ name = 'Pharmacist', payment = 75 },
{ name = 'Senior Pharmacist', payment = 100 },
{ name = 'Manager', payment = 125, isboss = true },
},
},| Field | Meaning |
|---|---|
name | Job name. Must match the job name on the pharmacy |
label | Display name |
defaultDuty | On duty when the job is assigned. true means the clerk does not have to clock in first |
offDutyPay | A number pays that amount while off duty. false pays nothing |
type | Service grouping. 'none' for a normal job |
grades | Array, lowest grade first. Each entry has name and payment; isboss = true marks the boss grade |
Kora grades start at 1, the script's grades start at 0. The bridge converts, so Clerk stays grade 0 in /setupprescriptions and in every rank setting. Do not shift your numbers by one.
A kora_core update can overwrite shared/jobs.lua, so keep a copy of your addition. A resource can also register the job at runtime with exports.kora_core:registerShared('jobs', 'pharmacy', record), but Kora removes records a resource registered when that resource stops, so the seed file is the safer place.
Point the pharmacy at it
In /setupprescriptions, open Shops, pick the pharmacy, and set the job name.
If you rename the job, say to moreos, change it in your framework and on every pharmacy that uses it.
Who can do what
These live on the Who can do what page, and the pharmacy rank is also set per shop on Shops.
| Setting | What it gates |
|---|---|
| Who can write a script | Which jobs can use the prescription pad, and from what rank. Pick the job and its lowest rank |
| Lowest rank to fill | Clocking in, the register, bottling, the medical cabinet and supply runs |
| Lowest rank for the back office | The pharmacy tablet: search, print, flag, revoke, supply orders and stock |
| Controlled medication minimum rank | The doctor rank needed to write a controlled medication. 0 turns it off |
| Controlled medication mixing rank | The pharmacy rank needed to make a controlled medication at the bench. 0 turns it off |
| Who gets the call | The jobs pinged for the panic button, forged scripts and shoplifting |
Each rank is a minimum grade, with 0 as the lowest. Admin access to /setupprescriptions comes from the framework admin check in Newb_Bridge. Staff also have to be clocked in for the register, bottling, the cabinet, supply runs and the panic button, and the tablet's doctor-record actions.
No player pharmacy?
Leave the job empty on the Shops page. That pharmacy becomes an NPC pharmacist who fills scripts when patients bring the paper. Sales are split between the NPC payout jobs, equally.
