Replace qbx_radio
Move from qbx_radio to Patrolink on FiveM without touching your scripts: exports and events that keep working, the radio item, channels and the watchdog.
Patrolink is built to take qbx_radio's place without touching your other scripts. This guide covers what changes, what stays the same and how to switch radios on a server that's already running.
What stays the same
Patrolink's fxmanifest.lua declares:
provide 'qbx_radio'
On top of that, Patrolink also registers its exports under the qbx_radio name. So the scripts you already use (police tablets, EMS scripts, HUDs…) keep working:
| What your scripts use | With Patrolink |
|---|---|
exports.qbx_radio:IsRadioOn() | Patrolink answers. |
exports.qbx_radio:getCurrentChannel() | Patrolink answers (0 when off, with no channel or no access). |
exports.qbx_radio:SetChannel(freq) | Tunes and turns the radio on. Returns false if the player has no radio or no access. |
exports.qbx_radio:LeaveChannel() | Leaves the channel. |
exports.qbx_radio:powerOff() | Turns the radio off. |
exports.qbx_radio:reapplyRadio() | Re-applies the channel in pma-voice. |
qbx_radio:client:channelChanged event | Still fired, with the frequency (0 = no channel). |
qbx_radio:client:powerChanged event | Still fired, with true or false. |
The full list, including Patrolink's own exports, is in Integration and exports.
What changes
- The
radioitem. Qbox and QBCore ship aradioitem. Patrolink uses that same name for the PL-3, but withstack = false: every radio carries its own serial number and tuning. Replace the entry inox_inventory/data/items.luawith the one ineleven_radio/install/items.lua. - A new item,
radio_pl7, for the PL-3T service radio, plus an optionalradio_decryptor. - Configuration. Restricted channels and the dial range live in Patrolink's
config/config.lua. Out of the box: 1 to 10 forpoliceandambulance, and a dial up to 500 with two decimals. If you had other values in qbx_radio's config, move them to their equivalent:
| In qbx_radio | In Patrolink |
|---|---|
restrictedChannels | Config.RestrictedChannels |
maxFrequency | Config.Dial.maxFrequency |
decimalPlaces | Config.Dial.decimals |
- The server watchdog. Patrolink removes anyone without a radio turned on from the dial (1–500). If another script puts players in that range, see step 6.
- No jammer. Patrolink 1.0 doesn't include qbx_radio's jammer.
Steps
Back up your
ox_inventory/data/items.luaand note down the restricted channels in your qbx_radio config.Stop the server.
Remove qbx_radio: take its folder out of
resources/or comment out itsensure. Don't run both at once.Install Patrolink following Installation: the
eleven_radiofolder, items, images andserver.cfg.Move your channels to
Config.RestrictedChannels(and your jobs toConfig.ServiceJobs). If you use names likelspdorbcso, see Channels and frequencies.Check scripts that use pma-voice directly. If any of them puts players on channels 1 to 500 without going through the radio, move it above 500 or return
truefor those players inConfig.Hooks.WatchdogExempt(config/hooks.lua). See Security.Order
server.cfg. Scripts that depend on qbx_radio go aftereleven_radio:ensure pma-voice ensure eleven_radio # scripts that use exports.qbx_radio ensure my-police-tabletStart the server and test with a player: use the radio, tune a free channel and a restricted one while on duty.
Note
Radios players already own are still radio items and become a PL-3. Patrolink gives each one its serial number the first time it's used.
If you want to keep qbx_radio
You can run both resources, but then Patrolink can't stand in for qbx_radio:
- Delete the
provide 'qbx_radio'line from Patrolink'sfxmanifest.lua. - Call Patrolink as
exports.eleven_radio:*and listen toeleven_radio:client:channelChangedandeleven_radio:client:powerChanged. - Use different item names for each radio (
Config.Models).
While qbx_radio is running, Patrolink doesn't register its exports under that name.
Migration issues
- My scripts error when calling qbx_radio: check that qbx_radio is stopped, that
eleven_radiostarts before those scripts and that thefxmanifest.luastill hasprovide 'qbx_radio'. - NO ACCESS on the police channel: your jobs aren't called
policeorambulance. See Channels and frequencies. - I get kicked off the channel every few seconds: that's the watchdog. See step 6.
More cases in Troubleshooting.