JCKSDocs
JCKS LibZačíname

Installation

How to install jcks_lib, where it goes in server.cfg and how to upgrade from jcks_ui.

jcks_lib needs FiveM server artifact 7290 or newer, the same minimum as jcks_bridge, and no other resource. It can start first and has to start before every other JCKS resource.

server.cfg

cfg
ensure oxmysql
ensure ox_lib

ensure jcks_lib
ensure jcks_bridge
ensure jcks_jobs
ensure jcks_vehicles

oxmysql is needed by JCKS Bridge and the paid scripts. jcks_lib only uses it for the library of installed theme presets (table jcks_market_items) and starts without it. ox_lib is optional for jcks_lib. It is only used when the bridge setup picks it as the provider for notifications, progress, skill checks or text UI.

Folders

Folder What it is On an update
settings/ Your settings (settings/config.lua). Files in settings/ are sent to players. *.json files are written by the script. Keep it, do not upload it again
defaults/ Untouched copies of the settings of this version. Never edit them, the script compares your files against them. Upload it
everything else The script itself Upload it

To update, upload everything except settings/ and restart the resource. What the merge reports is described in Updates.

Upgrading from jcks_ui (V1)

  1. Upload jcks_lib next to jcks_ui.
  2. Change ensure jcks_ui to ensure jcks_lib in server.cfg.
  3. Start the server.

On the first start jcks_lib copies config.lua of jcks_ui into settings/config.lua once and lists what changed. The new values apply after the next restart. The old key Config.PlayerSettings.preset is moved to Config.PlayerSettings.theme. If jcks_ui still runs, it is stopped. Remove its folder afterwards. Files you already changed in V2 are never overwritten. Database data stays as it is.

Player UI settings from V1

V1 saved every player's UI settings on the player's PC in the KVP jcks:player of the jcks_ui resource. jcks_lib reads them from there.

  • First start. A player who has no V2 settings yet gets the V1 ones the first time jcks_lib starts on their PC. The V1 look becomes the closest V2 theme: mono and carbon become asphalt, midnight stays midnight, light mode becomes paper, everything else stays on the server theme. Language, size and sounds carry over. The F8 console shows what was imported.
  • Button. /uisettings shows Settings from V1 while V1 data exists. Import fills in what is missing. When a value already differs in V2, the window asks first: Fill in only keeps the V2 values, Overwrite takes the V1 ones.
  • Only fields the server lets players change are imported.
  • The settings before an import are kept in KVP jcks:player:backup, the import itself is marked in jcks:player:v1.

The server side look (theme, scale, branding, what players may change) was a JCKS Bridge setting in V1. JCKS Bridge imports it, see Bridge V2 installation.

Using jcks_lib in your own resource

Two ways, use one or both.

The UI global, a thin wrapper around the exports:

lua
shared_script '@jcks_lib/import.lua'

dependencies { 'jcks_lib' }

The core modules (jcks.callback, jcks.points and the rest), loaded inside your resource:

lua
shared_script '@jcks_lib/init.lua'

If jcks_lib is missing, import.lua stops your resource with jcks_lib is not installed. Add it to the server and start it before this resource. and init.lua with jcks_lib is not installed. Every JCKS resource needs jcks_lib and jcks_bridge.