Skip to content

Frameworks and inventories

Qbox (qbx_core), QBCore (qb-core), ESX Legacy (es_extended) and ox_core (ox_core) are detected automatically, in that order. set meridian_framework "qbox" (or "qbcore", "esx", "ox") picks one explicitly, and "standalone" turns framework support off.

A player’s job gives them an agency while they’re on duty. Agencies from ACE and Discord roles are added on top.

set meridian_jobs "police=lspd,sheriff=bcso,ambulance=fire" # job=agency pairs
set meridian_require_onduty "true" # off-duty players get no job agency
set meridian_duty_power "true" # radio switches on when going on duty, off when going off duty
set meridian_item "radio" # optional: must carry this item; using it toggles the radio

Radios start switched off. Players turn them on and off with the power key. With meridian_duty_power on, a player in one of the meridian_jobs jobs also has the radio switched on when they go on duty and off when they go off duty. ESX versions without a duty flag count everyone in a job as on duty.

With ox_core, groups are the jobs: list group names in meridian_jobs (police=lspd). ox_core has no duty flag of its own, so a player is on duty in a group while it’s their active group (set with ox_core’s setActiveGroup, usually by a duty script). A player in the police group with no active group, or a different one, is off duty. If your server doesn’t use active groups, turn the duty check off so group members always get their agency:

set meridian_require_onduty "false"
set meridian_duty_power "false"

The radio name is the character’s last name (ox_core has no callsign). ox_core has no inventory of its own, so the radio and tablet items are checked in ox_inventory.

By default a radio shows the name its player set with /radioname, then the framework name (callsign, if the framework has one, plus last name), then the player’s FiveM name. meridian_alias sets which of those are used, and in what order:

set meridian_alias "custom,framework,player" # default
set meridian_alias "framework,player" # players can't rename radios
set meridian_alias "custom,player" # ignore the framework name

With custom in the list, players name the radio they’re holding in any of these ways:

  • /radioname Medic 4. /radioname - clears the name, so the radio goes back to the next name in the list.
  • /radioname on its own, or the “Radio: set name” key (unbound by default, set it in the game’s key bindings), opens a text box.
  • Another resource calls the setName client export or the setRadioName server export (player API, server API).

Names are up to 24 characters; color codes and control characters are removed. Anyone holding a radio can rename it. Each rename is written to the server console. This matters most on servers without a framework, where one character may work for several departments and needs to change what their radio shows.

With meridian_item set, the radio is an item: players who don’t carry it can’t open the radio or switch it on, whether with the keys, /radiopower, going on duty or another resource’s exports. Trying shows “You don’t have a radio.” Within a few seconds of the item leaving their inventory, the radio switches off and hides. Picking the item up works straight away: the next press of the show or power key opens it.

The item is checked in ox_inventory when it’s running (with any framework, and on standalone servers too), otherwise in qb-inventory or the framework’s own inventory. A standalone or ox_core server without ox_inventory has no inventory to check, so the setting does nothing there (the server console warns about this).

The radio server also refuses to connect a radio whose player doesn’t carry the item, so a modified client can’t get around it.

With ox_inventory, add the item to ox_inventory/data/items.lua so using it toggles the radio (use your folder name instead of meridian if you renamed the resource):

['radio'] = {
label = 'Radio',
weight = 500,
stack = false,
client = { export = 'meridian.useItem' },
},

Without ox_inventory, Meridian registers the usable item with QBCore or ESX itself.

With meridian_duty_power on as well, going on duty only switches the radio on for players carrying the item, and an on-duty player’s radio switches on when they pick the item up.

The in-game dispatch tablet can be an item too, separate from the radio:

Terminal window
set meridian_tablet_item "tablet"

Players who don’t carry it can’t open the tablet, whether with /dispatch, the keybind or another resource’s exports; they see “You don’t have a dispatch tablet.” Using the item opens or closes the tablet, and the tablet closes within a few seconds of the item leaving their inventory. The item is checked in the same inventories as the radio item. It must be a different item from meridian_item.

The item only decides who can open the tablet. Dispatchers still sign in to the console with their own account, so finding a tablet doesn’t give anyone access to dispatch.

With ox_inventory, add it to ox_inventory/data/items.lua:

['tablet'] = {
label = 'Dispatch tablet',
weight = 800,
stack = false,
client = { export = 'meridian.useTablet' },
},

Without ox_inventory, Meridian registers the usable item with QBCore or ESX itself.

When the community uses radio batteries with spare batteries on, the radio_battery item (or the item in meridian_battery_item) puts a full battery in the radio. See the batteries guide for the ox_inventory item definition.

With ox_inventory or qb-inventory, a radio item remembers who it is: its unit ID, its name and its channels are stored on the item. If a player drops their radio and someone else picks it up, it’s still the first player’s radio. It shows the same name and unit ID to dispatch and on other radios, and keeps the same channels. This works with any framework, including ESX, ox_core and standalone servers running ox_inventory.

  • Programming. A new radio is programmed for the first player who connects with it: their unit ID, their name and the channels their job, ACE and Discord roles give them.
  • The owner’s radio follows them. While the owner holds it, the radio keeps up with them: changing job, going on or off duty, or getting new Discord roles changes its channels, and their name updates.
  • Anyone else gets it as the owner left it. Someone else holding it gets the owner’s channels and name, frozen at the moment the owner last had it. They can rename it with /radioname, if names are allowed.
  • Reprogramming. /radioprogram programs the radio in hand for whoever holds it, as if new: their unit ID, channels and name, with any custom name cleared. /radioprogram 1234567 gives it that unit ID instead (1 to 9,999,999). From the server console, add the player’s server ID: radioprogram - 12 or radioprogram 1234567 12. The command needs an ACE, for example add_ace group.admin command.radioprogram allow. Resources can do the same with the programRadio server export.

ox_inventory with a radio item hovered, its description showing the radio’s name and unit ID

The item’s description in the inventory shows the radio’s name and unit ID, so players can tell radios apart. A player carrying more than one radio uses the one they used last (or the first one, until they use one).

Two radios can end up with the same unit ID, for example two new radios programmed for the same player. If both are switched on, the newer connection takes over and the other radio shows “this unit ID connected from another radio”. /radioprogram <unit ID> gives one of them a different ID.

The ESX inventory and inventories without item metadata can’t store this, so there the radio belongs to the player: their own unit ID, name and channels, whichever radio item they carry. set meridian_item_identity "false" does the same on ox_inventory and qb-inventory. Custom names then belong to the character (QBCore citizen ID, ESX identifier, ox_core character ID) or, on standalone servers, to the player’s license.