Overview
Multijob lets a character keep every job they're given and switch between them. Every job change on the server is remembered, whichever script makes it, so a deputy who also runs a shop can swap between the two without asking staff.
- A jobs menu (
/multijob, or/mjon its own) listing every job with its grade, the working one marked. /mj 2switches straight to the 2nd job.- Go unemployed, quit one job, or quit them all.
- A staff panel (
/mjadmin) for online and offline characters, with job presets. - An API for other scripts, and poggy_core's jobs provider, so shop and business scripts hire and fire through it.
Multijob is free. You can use it and change it on your own servers; please don't sell it or re-upload it (see LICENSE.md).
Requirements
- poggy_core (free), version 0.25.0 or newer.
- oxmysql.
- One of VORP, RSG Core or QBCore RedM (poggy_core connects the script to it).
- No other multijob running at the same time (Poggy Multijob, VORP's or RSG's own). poggy_core accepts one jobs provider.
Install
- Download
Britannia_Multijobfree from playbritannia.co. - Put the
Britannia_Multijobfolder in your server'sresourcesfolder. - Add
ensure Britannia_Multijobtoserver.cfg, afterensure oxmysqlandensure poggy_core. - If you run another multijob, remove its
ensureline. - Set who counts as staff and your job presets in
shared/config.lua(see Configuration). - Restart the server.
The table britannia_multijob is created automatically.
Coming from Poggy Multijob? On the first start, every saved job in the poggy_multijob table is copied across, so players keep their jobs. The old table is left untouched as a rollback.
Configuration
Settings are in shared/config.lua, and every option is commented. Text is in locales/en.lua.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language file to use from locales/ | 'en' |
Config.Debug | Prints extra lines in the server and F8 consoles | false |
Config.Commands | The command names: Menu, Switch, Admin | multijob, mj, mjadmin |
Config.MaxJobs | The most jobs a character can hold (0 = no limit) | 3 |
Config.DefaultJob | The job a character goes back to when they quit their working job or go unemployed: name, grade, label | unemployed, 0, Unemployed |
Config.IgnoreJobs | Job names that are never kept on the list | unemployed, none, unknown |
Config.SwitchCooldown | Seconds between job switches | 10 |
Config.SyncInterval | Seconds between saving every online player's job and name | 600 |
Config.AdminAce | Ace that opens the staff panel | 'britannia_multijob.admin' |
Config.AdminGroups | Groups that open the staff panel | admin, superadmin, moderator |
Config.ImportPoggyMultijob | Copy saved jobs from poggy_multijob on the first start | true |
Config.Presets | The staff panel's ready-made jobs, in groups: job name, label and the grades to offer | examples |
server/sv_config.lua holds the Discord webhook for the staff and quit log (SvConfig.Webhook).
Commands and permissions
| Command | Who | What it does |
|---|---|---|
/multijob | Everyone | Opens your jobs menu |
/mj <number> | Everyone | Switches to that job; /mj on its own opens the menu |
/mjadmin | Staff | Opens the staff panel |
Staff are anyone with the ace britannia_multijob.admin, anyone in Config.AdminGroups, and poggy_core admins. For example: add_ace group.admin britannia_multijob.admin allow.
How it works
For players. The menu lists every job held, numbered, with its grade. The working one is marked. Pick a job to switch to it, or choose Go unemployed (the list is kept), Quit a job or Quit every job, each with a confirm. Quitting the job you're working puts you on Config.DefaultJob.
Every job is remembered. Whenever a script, boss menu or admin command changes a character's job, both the job they left and the one they took are saved. Online players are also saved when they open the menu and every Config.SyncInterval seconds.
The staff panel. Three ways in:
- Online players: pick a player.
- Find a character: search by name, offline characters included.
- Who holds a job: pick a job and see everyone holding it.
For any character, staff can make a job their working job, change a grade, remove a job, or add a job from the presets or by typing it in. Offline characters work too; their working job is changed in the framework's own table.
For other scripts. Server exports (call them from a thread):
local ok, reason = exports.Britannia_Multijob:AddJob(target, job, grade, label)
local ok, reason = exports.Britannia_Multijob:RemoveJob(target, job)
local ok, reason = exports.Britannia_Multijob:SetJobGrade(target, job, grade)
local has, reason = exports.Britannia_Multijob:HasJob(target, job)
local jobs, reason = exports.Britannia_Multijob:GetJobs(target)target is an online player's server id (a number) or a character id (a string, which works offline too). It also registers as poggy_core's jobs provider, so any script using poggy_core's jobs.of, jobs.holders, jobs.add, jobs.remove or jobs.setGrade reads and changes these lists without naming this script.
Troubleshooting
The console says another script "already is" the jobs provider
Another multijob is running. Stop it (stop poggy_multijob, for example), remove its ensure line, then restart Britannia_Multijob.
Players' old jobs are missing
The copy from poggy_multijob only runs while this script's table is empty and Config.ImportPoggyMultijob = true. Check the server console for "Copied N saved job(s)".
"You are not allowed to use the staff panel."
Give the player the ace britannia_multijob.admin, or add their group to Config.AdminGroups.
A fired employee still has the job on their list
A plain "set job" is saved like any job change. Remove it from the staff panel, or have the employer's script call RemoveJob or jobs.remove.
"They already hold 3 jobs, the most allowed."
The character is at Config.MaxJobs. Remove a job first, or raise the limit.
Switching says to wait
Config.SwitchCooldown stops rapid switching. Lower it, or set it to 0.
Version history
- 1.0.0: first public release.
Still stuck?
Open a ticket on our Discord with your framework, your poggy_core version and what you see, and we'll help you get it running.
Get help on Discord