Installation
Overview
ML Radio adds handset radios on pma-voice, with signal that depends on antennas, jammers, hackable towers, broadcast stations limited to jobs, speaker zones and placeable stereos. Placed antennas, jammers and stereos are saved to the database.
Quick Start
- Download from CFX Portal
- Extract to your
resourcesfolder asml_radio - Add to
server.cfg:
1ensure oxmysql
2ensure ox_lib
3ensure pma-voice
4ensure ml_bridge
5ensure xsound
6ensure ml_radioml_radio must start AFTER ml_bridge and pma-voice.
The download ships a pma-voice folder next to ml_radio. It is pma-voice with a second radio channel added, which is what lets the handset talk on one frequency while monitoring another. Install it in place of your current pma-voice, or port the setSecondRadioChannel export into your own copy. On stock pma-voice the dual channel switches itself off, prints one warning and everything else runs unchanged.
Database
Tables are created automatically on first start:
ml_radio_antennas: antennas placed by players, with position, health and lockoutml_radio_fixed_antennas: health and lockout of the fixed towersml_radio_jammers: placed jammers, with position, power and healthml_radio_data: key and value store, used for placed stereos
The radio state of each handset lives in its item metadata, so a handset keeps its frequencies, callsign and charge when it changes hands.
_INSTALL/sql.sql holds the same four statements for anyone who prefers to create them by hand.
Item Registration
Register the following items in your inventory system. Ready-to-paste definitions ship in _INSTALL/items.lua, and _INSTALL/ox_items.txt is pre-formatted for ox_inventory/data/items.lua:
radio: Handsetradio_jammer: Placeable jamming towerradio_antenna_small/radio_antenna_medium/radio_antenna_large: Placeable antennasboombox/pa_speaker: Placeable stereosbattery_pack: Battery, recharges handsets and jammerselectronic_kit/metal_scrap: Repair materialshacking_device: Required to hack antennas
Icons for all of them ship in _INSTALL/inventory_images/. Copy them into ox_inventory/web/images/.
Handset and consumable names live in Config.Items. Antenna and jammer names live with their models in Config.Antenna.tiers and Config.Jammer.tiers. Stereo names live in Config.StereoProps.items.
The custom tower model used by the large antenna and the fixed towers is streamed from the resource itself. Everything else uses base-game props. Nothing extra to install.
Verify
In game, use a radio item from your inventory and tune a frequency near a tower. The signal bars read above zero.
- Radio opens but nobody hears voice: check that
pma-voiceis running and started beforeml_radio. - Stations and boomboxes play no music:
xsoundis missing orConfig.Broadcast.streamingProvider = 'none'. Voice radio is unaffected. - Using the item does nothing: the item is not registered in your inventory, or its name does not match
Config.Items.radios. - "No signal" everywhere: signal starts at
Config.Signal.baseSignalWithoutAntenna = 0; coverage comes from fixed towers and placed antennas. Check the tower coords are loaded. - Nothing posts to Discord: the webhooks in
server/config_server.luaship as theINSERT_WEBHOOK_LINK_HEREplaceholder; fill in real URLs.