Skip to content

Custom Integrations

The entire custom/ folder is open under asset escrow. Every supported resource has one readable adapter, and each integration kind includes a custom.lua template. Never edit encrypted files under client/, server/, or shared/.

  1. Open your third-party resource’s official documentation
  2. Find its client/server export for the action you need
  3. Set the matching integration slot to 'custom' in config/shared.lua
  4. Implement the adapter in custom/fuel/custom.lua, custom/keys/custom.lua, or custom/target/custom.lua
  5. Ensure the third-party resource before lx-busjob
  6. Restart and check the integration log in the client/server console

Each file registers handlers by integration kind and exact resource name:

LxBusIntegrations.Register('fuel', 'my_fuel', {
setFuel = function(vehicle, amount)
exports['my_fuel']:SetVehicleFuel(vehicle, amount)
end,
})

Then select it by exact name:

Config.Integrations.fuel = 'my_fuel'

You have two supported approaches:

  1. Use custom — edit the existing custom/<kind>/custom.lua template and select 'custom'
  2. Add a named adapter — copy a neighboring adapter, rename its file and registration name, then select that resource name

Example key adapter:

-- custom/keys/my_keys.lua
LxBusIntegrations.Register('keys', 'my_keys', {
giveKeys = function(source, vehicle, plate)
exports['my_keys']:GiveKeys(source, plate)
},
})
Handler Runtime Arguments Required return
fuel.serverSetFuel Server vehicle, amount none
fuel.setFuel Client vehicle, amount none
keys.giveKeys Server source, vehicle, plate none
target.addEntityTarget Client entity, options true when registered
target.removeEntityTarget Client entity none

serverSetFuel is optional and only needed by state-bag/server-owned fuel systems. All handlers run through pcall; failures print the adapter kind, name, handler, and error without crashing the bus job.

fuel.setFuel and target handlers run client-side. fuel.serverSetFuel and key handlers run server-side. Calling a client-only export from a server handler will fail even if the export name is correct.

Export resource names are exact and case-sensitive:

exports['My-Fuel'] -- not the same as exports['my-fuel']

target.addEntityTarget must return true. Otherwise Advanced Bus Job assumes registration failed and displays its [E] fallback.

Do not edit client/bridge.lua, server/bridge.lua, or shared/bridge.lua. They are escrow-protected and replaced on updates. Files under custom/ are the supported extension point.

Include:

  • a link to the third-party resource’s official export documentation
  • its exact resource folder name
  • whether the export is client or server side
  • your adapter code and full console error

We cannot safely integrate undocumented or leaked resources.