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
ensure oxmysql
ensure ox_lib
ensure jcks_lib
ensure jcks_bridge
ensure jcks_jobs
ensure jcks_vehiclesoxmysql 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)
- Upload
jcks_libnext tojcks_ui. - Change
ensure jcks_uitoensure jcks_libinserver.cfg. - 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:
monoandcarbonbecomeasphalt,midnightstaysmidnight, light mode becomespaper, everything else stays on the server theme. Language, size and sounds carry over. The F8 console shows what was imported. - Button.
/uisettingsshows 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 injcks: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:
shared_script '@jcks_lib/import.lua'
dependencies { 'jcks_lib' }The core modules (jcks.callback, jcks.points and the rest), loaded inside your resource:
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.