Yecoyz.
Docs/yecoyz_core

Configuration

Every option in the Yecoyz Core config file, and where to change the code.

All settings are in config.lua. Each one is 'auto' by default, so Core works on most servers without changes.

Framework

Framework

Which framework to use. 'auto' picks the first one running: es_extended (ESX), qbx_core (Qbox), qb-core (QBCore), otherwise standalone.

lua
Config.Framework = 'auto' -- 'auto' | 'esx' | 'qbox' | 'qb' | 'standalone'
Tip

Set it to a specific framework if you run more than one framework resource and auto picks the wrong one.

Inventory

Inventory

'auto' uses ox_inventory when it runs, otherwise the framework's own inventory.

lua
Config.Inventory = 'auto' -- 'auto' | 'ox_inventory' | 'framework'

Notifications

Notify

Where notifications are shown. 'auto' tries ox_lib first, then the framework, then the GTA feed.

lua
Config.Notify = 'auto' -- 'auto' | 'ox_lib' | 'framework' | 'native'

NotifyTitle

The default title for ox_lib notifications. nil means no title.

lua
Config.NotifyTitle = nil

NotifyDuration

How long a notification stays on screen, in milliseconds.

lua
Config.NotifyDuration = 5000

Jobs

BossGrades

ESX has no boss flag on jobs. These grade names count as boss in GetJob().isBoss. QBCore and Qbox already have one, so this only applies to ESX.

lua
Config.BossGrades = { 'boss' }

Money

MoneyItem

The item used for cash when there is no framework but ox_inventory runs.

lua
Config.MoneyItem = 'money'

Debug

Debug

When true, Core prints its debug messages to the console.

lua
Config.Debug = false

Changing the code

Core is open source, so you can change it for your server. The main files are:

File What it does
shared/framework.lua Framework detection, the job shape every framework returns, and Core.Debug
server/framework.lua Server functions: players, jobs, money, items, duty and permissions
client/framework.lua Client functions: player data, job, money and items
server/inventory.lua Item functions for ox_inventory and the framework inventory
client/notify.lua The notification providers used by Notify
server/events.lua / client/events.lua The player loaded, player unloaded and job updated events
import.lua The Core global the scripts use, and the callback system

Some things to keep in mind when you change it:

  • Keep the function names and return shapes the same. The Yecoyz scripts depend on them, so if you change a shape, check every script that calls it.
  • To support a framework that isn't built in, add it to the frameworks list in shared/framework.lua, then handle it in server/framework.lua and client/framework.lua.
  • Run node tests/run.cjs after a change. It syntax-checks every Lua file and runs the callback and framework tests.
  • Changes to the files in server/ and client/ take effect after restart yecoyz_core. Scripts that already loaded import.lua keep working, because they call Core through exports.
Warning

If you change Core and then update it from GitHub, your changes are overwritten. Keep your edits in a fork, or note them so you can merge them again after an update.