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.
Config.Framework = 'auto' -- 'auto' | 'esx' | 'qbox' | 'qb' | 'standalone'TipSet it to a specific framework if you run more than one framework resource and
autopicks the wrong one.
Inventory
Inventory
'auto' uses ox_inventory when it runs, otherwise the framework's own inventory.
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.
Config.Notify = 'auto' -- 'auto' | 'ox_lib' | 'framework' | 'native'NotifyTitle
The default title for ox_lib notifications. nil means no title.
Config.NotifyTitle = nilNotifyDuration
How long a notification stays on screen, in milliseconds.
Config.NotifyDuration = 5000Jobs
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.
Config.BossGrades = { 'boss' }Money
MoneyItem
The item used for cash when there is no framework but ox_inventory runs.
Config.MoneyItem = 'money'Debug
Debug
When true, Core prints its debug messages to the console.
Config.Debug = falseChanging 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
frameworkslist inshared/framework.lua, then handle it inserver/framework.luaandclient/framework.lua. - Run
node tests/run.cjsafter a change. It syntax-checks every Lua file and runs the callback and framework tests. - Changes to the files in
server/andclient/take effect afterrestart yecoyz_core. Scripts that already loadedimport.luakeep working, because they call Core through exports.
WarningIf 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.