Framework
The resource works out of the box with ESX and QBCore, but you can include your own framework. Also, the resource detects automatically if you are using ESX or QBCore.
Manual framework set up
Navigate to configs/sh_config.lua.
There you will find the following lua code:
Framework = {
ESX = 'esx',
QBCore = 'qbcore',
Custom = 'custom',
}
CONFIG.Framework = Framework.ESX -- ESX or QBCore or CustomHere modify the code in the following ways:
CONFIG.Framework = Framework.ESX
-- or
CONFIG.Framework = Framework.QBCore
-- or
CONFIG.Framework = Framework.CustomModify ESX or QBCore methods
Client Side
You can find the client framework stuff inside client/api/framework/bridge.lua. In the client you will find a function like this for each framework with every method or event required inside:
Here you can modify each method to your needs.
Server Side
You can find the server framework stuff inside server/api/framework.lua. In the server you will find a function like this for each framework with every method or event required inside:
Here you can modify each method to your needs.
Custom Framework
To use a custom framework, follow these steps:
Create your own framework methods or events.
Inside the client-side code (client/api/framework/bridge.lua), create a new function for your custom framework and define the required methods and events. It is required to follow the structure of the functions for the traditional frameworks, an example for client would be:
Inside the server-side code (server/api/framework.lua), create a new function for your custom framework and define the required methods and events. We recommend copying the function for a traditional framework and replace the events and function for your own custom framework methods.
Modify the framework setup in configs/sh_config.lua:
This ensures that the custom framework is used.
Last updated
Was this helpful?