JCKSDocs
JCKS JobsV2Bien démarrer

Installation

How to install JCKS Jobs 2.0.0, in which order to start it and who can open the admin panel.

1. Upload the resources

Put jcks_lib, jcks_bridge and jcks_jobs into your resources folder.

2. server.cfg

JCKS Jobs starts after everything the bridge talks to. jcks_lib starts before jcks_bridge.

cfg
ensure oxmysql

ensure qbx_core
ensure ox_inventory
ensure ox_target

ensure jcks_lib
ensure jcks_bridge
ensure jcks_vehicles
ensure jcks_jobs

add_ace group.admin jcks_jobs.admin allow
add_principal identifier.license:YOUR_LICENSE group.admin
add_ace resource.jcks_bridge command allow
Line Notes
qbx_core Or es_extended, qb-core, ox_core
ox_inventory Or qb-inventory or another inventory the bridge supports
ox_target Optional: ox_target, qb-target, tgiann-target, or JCKS interactions from jcks_lib
Banking, keys, fuel, clothing, voice Start them before jcks_lib as well
jcks_logs, jcks_vehicles Optional, see Optional resources
add_ace group.admin jcks_jobs.admin allow Lets the group.admin group open /jobadmin
add_principal identifier.license:YOUR_LICENSE group.admin Puts your account into group.admin. Your license is in txAdmin, Players. Required on Qbox and QBCore, which never read an admin flag from the database
add_ace resource.jcks_bridge command allow Lets the bridge restart JCKS resources after setup changes and imports

Your robbery, heist or shop scripts send alerts and bills through ps-dispatch, cd_dispatch, esx_billing or okokBilling? JCKS Jobs answers esx_billing, okokBilling and several dispatch scripts by itself. The [jcks_compat] resources for ps-dispatch and cd_dispatch come with a later update, see Existing scripts.

3. Database

Every table is created and migrated when the resource starts. There is no SQL file to import. install/schema.sql is a reference copy of the schema for admins who want to read it or create the tables by hand.

The file starts like this:

sql
CREATE TABLE IF NOT EXISTS `jcks_jobs` (
    `name` VARCHAR(50) NOT NULL,
    ...

Missing columns (for example overdue on invoices, ref on evidence, approved_by and approved_at on reports) are added on start.

4. Items

The restraint, medical, forensic, gig, restaurant and template items are in install/, their pictures in install/images/:

File Where it goes
install/ox_inventory.lua ox_inventory/data/items.lua
install/qb-core-items.lua qb-core/shared/items.lua
install/esx-items.sql ESX items table

Items the scripts need at minimum: handcuffs, handcuff_key, zipties (field tools), mdt (the MDT tablet, Config.Dispatch.mdtItem, not stackable), evidence_bag (used up when a trace is collected, Config.Forensics.collectItem), evidence_sealed (the sealed bag with the evidence number the officer gets, Config.Forensics.bagItem, not stackable), defibrillator, firstaid, bandage, painkillers, burncream, splint, medicalbag (medical). Set mdtItem, collectItem or bagItem to '' when you do not want that item. Gig templates use wood, stone, iron, gold, scrapmetal, goldchain, rolex, fish, tuna, potato, tomato, lettuce, onion. A missing item is skipped and logged, the action goes on.

Set consume = 0 for zip ties in ox_inventory. JCKS Jobs removes them itself when they are used.

5. First start

  1. Start the server. On the first start, while the jcks_jobs table is empty, every job your framework already has is imported with its grades, salaries and boss flags (ESX jobs and job_grades, QBCore shared jobs, the Qbox job config).
  2. If the bridge was never set up, the console prints a one time code. Join and run /jcks <code> to open the bridge setup. See Bridge installation.
  3. Run /jobadmin.

From then on JCKS Jobs is the source of truth. Every change in the studio is written back to the framework:

Framework Where jobs are written
ESX jobs and job_grades tables, then ESX.RefreshJobs()
QBCore QBCore.Shared.Jobs through the qb-core job exports
Qbox exports.qbx_core:CreateJob

Admin access

A player opens /jobadmin when one of these is true:

  • they have the ACE from Config.AdminAce (default jcks_jobs.admin),
  • the bridge permission jobs.admin lets them in (/jcks, Scripts, JCKS Jobs, Access),
  • their identifier is in ServerConfig.AdminIdentifiers (/jobadmin, Configuration),
  • their identifier is in the convar jobs_admin_licenses (kept from older versions).

Staff with only jobs.gigs or jobs.fire can open /jobadmin and see the Gigs or Fires page. jobs.doors opens the door list, jobs.settings the server settings.

cfg
set jobs_admin_licenses "license:abc,license:def"

Updating

Upload everything except settings/ and editable/ and restart the resource. On start jcks_lib compares your files with defaults/ and prints the result in the console and in /jcks, Overview: new settings use their default, settings no longer used are listed, your own list entries are never refilled, a settings file reset to defaults by mistake points to its .backup copy.