F.A.Q

3 min readUpdated 2 weeks ago

Setup

  1. Start oxmysql and ox_lib before it
  2. Check that the folder is named ml_bridge
  3. Read the server console for the missing dependency
  1. Start the resource before ml_bridge
  2. Check the folder name, for example ox_inventory and not ox-inventory
  3. Set Config.Debug = true and read the detection lines in the console

Replace 'auto' with the provider name:

config.lua
1Config.Inventory = 'ox'
2Config.Target = 'ox'
3Config.Fuel = 'legacy'

Framework

Qbox, QBCore, ESX, ox_core and standalone. ox_core has no jobs, so job and gang functions return empty values there.

Yes. Functions that need framework data, such as jobs, gangs and metadata, return empty values.

On load it stores the identifiers (license, Discord, Steam), character ID, character name and job, so logs can include them without extra database queries.

Inventory

The full list is on the Dependencies page. Each one is detected on its own.

lua
1local has = Bridge.HasItem(source, 'lockpick', 1)
2Bridge.RemoveItem(source, 'lockpick', 1)
3Bridge.GiveItem(source, 'bread', 5)

On the client: Bridge.HasItem('lockpick', 1).

Bridge.GiveItemToFit gives only what fits and returns the amount. Bridge.GiveItemOrDrop gives what fits and drops the rest on the ground next to the player.

lua
1local success, given = Bridge.GiveItemToFit(source, 'bread', 10)

Metadata such as { durability = { mathRandom = { 40, 90 } } } is turned into a final value before the item is given, dropped or placed in a stash. listRandom picks one value from a list and probabilityRandom picks by weight.

Target

ox_target, qb-target and sleepless_interact. Without one, players get a press-E prompt.

Logs

To Discord by default. Add Config.LogProvider to config_server.lua to send them to ox_lib, FiveManage, or several at once. Discord logs are sent in batches every Config.LogBatchInterval milliseconds.

Set its webhook to false in the config of that ML script:

lua
1Config.DiscordWebhook = {
2    LootCollect = false,
3}

Dispatch

The full list is on the Dependencies page. Without one, the alert becomes a map blip for 2 minutes and a notification for the jobs listed in the alert.

Admin Hub

/mladmin opens one menu with the admin panels of every installed ML script. Panels the player has no permission for are greyed out or hidden, as set in Config.AdminHub.lockedPanels.

Theme

Yes. Set Config.UITheme.preset and the colors in the ml_bridge config. Scripts that set their own Config.UITheme keep their values.

Waypoints

Very little. Only markers on screen use a DUI texture, taken from a shared pool and returned when the marker leaves the view. Visibility checks run every 100 ms by default.

Yes, for one player, a list of players or everyone:

lua
1exports.ml_bridge:WaypointCreate(source, data)
2exports.ml_bridge:WaypointCreate(-1, data)

Updates

  1. Download the latest version from CFX Portal
  2. Back up config.lua and config_server.lua
  3. Replace every file except those two
  4. Restart the server

No database changes.