Skip to content
ATY ScriptsDocsRadioRadio

Radio

📻 aty_radio

A feature-rich, immersive radio communication system for FiveM servers running ESX or QBCore frameworks. Supports real-time voice integration, locked job channels, radio license exams, radio tower hacking, channel passwords, and much more — all wrapped in a sleek Vue-powered NUI.


🔍 Overview

aty_radio is a complete in-game radio communication resource designed for FiveM roleplay servers. It provides players with a realistic walkie-talkie/radio experience, integrated with popular voice systems (pma-voice, mumble-voip, salty-chat). The script includes everything from a beautiful animated NUI interface to a job-locked channel system, radio tower hacking, and a licence examination system.

Built on top of aty_lib — a shared utility library — the script is fully framework-agnostic and works with both ESX and QBCore out of the box.


✨ Features

Feature Description
🎙️ Voice Integration Compatible with pma-voice, mumble-voip, and salty-chat. Automatically detects active voice resource.
📡 Channel System Players can connect to any numeric frequency channel.
🔒 Locked / Job Channels Certain channels are restricted to specific jobs (e.g., police, ambulance).
🔑 Channel Passwords Non-locked channels can be protected with a password set by the first user to join.
📨 Access Requesting Players without the correct job can send an access request to be manually approved.
✅ Request Management High-grade officers can accept or decline incoming channel access requests from the NUI.
👤 Custom Radio Names Players can set a custom alias that is displayed to other channel members instead of their character name.
👥 Connected Members List Real-time display of who is on the same channel, with live "talking" indicator.
⭐ Favorites Players can save frequently used channels to a favorites list.
🎓 Radio License Exam An in-world NPC and exam UI allows players to obtain a radio license (configurable questions, price, pass threshold).
🖥️ Radio Tower Hacking Players with the required items can hack a radio tower to intercept active frequencies.
🎒 Item Requirement The radio can require a physical inventory item (radio by default) to be used.
🎮 Command Support Optionally open the radio via a configurable chat command.
🎯 Target / Prompt System Supports aty_lib target zones or world-space 3D prompts (fallback) for exam NPC and hacking tower interactions.
🧟 Death Disconnect Automatically disconnects the player from their channel when they die (configurable).
📻 Radio Prop A physical GTA prop (prop_cs_walkie_talkie) is attached to the player's hand while the radio is open and stays in their hand while connected.
🌐 Multi-Framework Works with ESX and QBCore through the aty_lib abstraction layer.
🌍 Localization Fully localizable. Ships with an English locale. Additional languages can be added easily.

📦 Requirements & Dependencies

Dependency Required Notes
aty_lib ✅ Yes Core utility library. Must be started before aty_radio.
pma-voice OR mumble-voip OR salty-chat ✅ Yes (one of) Voice communication backend.
es_extended (ESX) OR qb-core (QBCore) ✅ Yes (one of) Player/job/inventory framework.
An inventory resource Recommended Required if ItemSettings.RequireItem = true.

[!IMPORTANT] aty_lib must be started and fully initialized before aty_radio. Ensure it is listed higher in your server.cfg.


🚀 Installation

Step 1 — Download & Place the Resource

Place the aty_radio folder inside your server's resources directory. The recommended path follows the [aty] category folder convention:

resources/
└── [aty]/
    └── aty_radio/

Step 2 — Add to server.cfg

Open your server.cfg and add the following lines. Make sure aty_lib comes before aty_radio:

ensure aty_lib
ensure aty_radio

Step 3 — Add the Required Inventory Item

If Config.ItemSettings.RequireItem is set to true (default), you must add a radio item to your inventory system.

For ox_inventory, add to items.lua:

['radio'] = {
    label = 'Radio',
    weight = 500,
    stack = false,
    close = true,
    description = 'A portable radio transceiver.',
},

For QBCore, add to QBShared/items.lua:

['radio'] = {
    name = 'radio',
    label = 'Radio',
    weight = 500,
    type = 'item',
    image = 'radio.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'A portable radio transceiver.'
},

[!NOTE] The item name is configurable via Config.ItemSettings.Item. You can change it to any existing item in your server.

Step 4 — Configure the Script

Open shared/config.lua and adjust all settings to match your server's setup. See the Configuration Reference section for details.

Step 5 — Add Hacking Items (Optional)

If the radio tower hacking feature will be used, ensure the items defined in Config.HackingSettings.UsbItem and Config.HackingSettings.LabtopItem exist in your inventory:

  • trojan_usb — USB drive used to initiate the hack
  • laptop — Laptop used alongside the USB

⚙️ Configuration Reference

All configuration is located in shared/config.lua.

General Settings

Config = {
    OldESX = false,           -- Set to true if using a very old ESX version (pre-1.9)
    RadioProp = "prop_cs_walkie_talkie", -- The GTA model name for the radio prop held by players
    AttachPropOnUse = true,   -- If true, keeps the prop attached after closing the menu (while in a channel)
    DisableOnDeath = true,    -- Automatically disconnects player from channel on death
    EnableShowUsers = true,   -- Show connected channel members list in UI
    EnableRequesting = true,  -- Allow players to request access to locked job channels
    EnableChannelPasswords = true, -- Allow the first joiner to set/require a channel password
    Target = true,            -- Use aty_lib circle zone targets for interactions (false = 3D world prompts)
}
Option Type Default Description
OldESX boolean false Enable legacy ESX compatibility mode.
RadioProp string "prop_cs_walkie_talkie" The spawned prop model. Can be any valid GTA vehicle/world model hash.
AttachPropOnUse boolean true Keeps the prop in hand after closing the UI, as long as the player is in a channel.
DisableOnDeath boolean true Disconnects the player from their radio channel when they die.
EnableShowUsers boolean true Enables the "Members" panel in the UI showing connected players.
EnableRequesting boolean true Allows civilians to request access to job-locked channels.
EnableChannelPasswords boolean true Enables the password mechanic for unprotected channels.
Target boolean true Use aty_lib target zones. Set to false to use the built-in 3D prompt fallback system.

Item Settings

ItemSettings = {
    RequireItem = true,   -- Player must have the radio item in their inventory
    Item = "radio",       -- The exact inventory item name
},
Option Type Default Description
RequireItem boolean true If true, possessing the configured item is required to open the radio.
Item string "radio" The item name as defined in your inventory system.

Command Settings

CommandSettings = {
    Enable = true,      -- Register a command to open the radio
    Command = "radio",  -- The command name (without the slash)
},
Option Type Default Description
Enable boolean true Registers a /radio command for players to open the UI.
Command string "radio" The command keyword. Change to avoid conflicts with other scripts.

Hacking Settings

HackingSettings = {
    UsbItem = "trojan_usb",    -- Item 1 required to start a hack
    LabtopItem = "laptop",     -- Item 2 required to start a hack
    HackingCoordinates = {
        {
            coords = vector4(739.2815, 1276.1788, 360.2965, 183.2185),
            hackTime = 15,     -- Seconds the cracking minigame runs
        }
    },
},
Option Type Description
UsbItem string Inventory item name for the trojan USB. Must be in player's inventory.
LabtopItem string Inventory item name for the laptop. Must be in player's inventory.
HackingCoordinates table Array of hack point locations. Each entry requires coords (vector4) and hackTime (integer, seconds).

Adding Multiple Hack Points:

HackingCoordinates = {
    {
        coords = vector4(739.28, 1276.17, 360.29, 183.22),
        hackTime = 15,
    },
    {
        coords = vector4(1234.56, -567.89, 72.00, 90.0),
        hackTime = 20,
    },
},

Exam Settings

ExamSettings = {
    Npc = {
        Enable = true,
        Coords = vector4(-267.8953, -964.2256, 31.2231, 295.3465), -- Where the NPC spawns
        Ped = "cs_tom",  -- GTA ped model name
    },

    Blip = {
        Enable = true,
        Coords = vector3(-267.8953, -964.2256, 31.2231),
        Sprite = 459,   -- GTA blip sprite ID
        Color = 5,      -- GTA blip color ID
        Label = "Radio Exam",
    },

    QuestionsToPass = 4,   -- Minimum correct answers to pass
    ExamPrice = 5000,      -- Cost deducted from player's cash to take the exam

    ExamQuestions = {
        {
            question = 'What is the minimum age for a radio license?',
            answers = {'18', '16', '21', '14'},
            correct = '18'
        },
        -- Add more questions here...
    },
},
Option Type Description
Npc.Enable boolean Spawn an exam NPC in the world.
Npc.Coords vector4 Position and heading of the NPC.
Npc.Ped string GTA ped model for the examiner.
Blip.Enable boolean Show a map blip for the exam location.
Blip.Sprite integer GTA blip sprite ID.
Blip.Color integer GTA blip color ID.
QuestionsToPass integer Number of questions the player must answer correctly to pass.
ExamPrice integer Amount of money deducted when starting the exam.
ExamQuestions table List of question objects. Each has question, answers (table of 4), and correct (string).

[!TIP] You can add as many questions as you want. The exam will randomly cycle through them. The answers table should always have exactly 4 options.


Locked Channels

Job-locked channels are exclusive frequencies that can only be joined by players with specific jobs. Other players must request access.

LockedChannels = {
    {
        name = "police",
        jobs = {"police", "sheriff", "ambulance"},
        frequency = 1,
        accepterGrade = 2    -- Minimum job grade level to accept requests
    },
    {
        name = "ambulance",
        jobs = {"police", "sheriff", "ambulance"},
        frequency = 3,
        accepterGrade = 2
    },
    -- Add more locked channels here...
},
Field Type Description
name string Identifier name for this locked channel (used internally).
jobs table List of job names that can freely join this channel.
frequency integer The channel number being restricted.
accepterGrade integer The minimum job grade needed to accept/decline access requests in the UI.

[!NOTE] A player whose job is in the jobs list can join freely. Players with a job not in the list will be denied access by default. If EnableRequesting = true, they can send a request instead.


HackDispatch Callback

This optional callback fires on the server whenever a hack is completed. Use it to alert nearby police units:

HackDispatch = function(serverId, ped, frequency)
    -- Example: trigger a dispatch alert to police
    -- TriggerEvent("dispatch:server:newDispatchAlert", {...})
end
Parameter Type Description
serverId integer The server ID of the player who performed the hack.
ped integer The ped entity handle of the hacker.
frequency integer The channel frequency that was targeted.

🌍 Localization

Localization strings are defined in shared/locale.lua. The active language is set on line 1:

Locale = 'en'

To add a new language, duplicate the ["en"] table, replace "en" with your language code (e.g., "tr", "de", "fr"), translate all string values, and change the Locale variable:

Locale = 'tr'

Locales = {
    ["en"] = { ... },
    ["tr"] = {
        ["no_radio"] = "Radyon yok",
        ["radio"] = "Radyo",
        -- ...all other keys...
    }
}

You can use the _L("key") function anywhere in shared, client, or server Lua files to retrieve a localized string.


📖 Usage Guide

Opening the Radio

There are two ways to open the radio UI:

  1. Command — Type /radio in chat (or whatever Config.CommandSettings.Command is set to).
  2. Item Usage — Use the radio item from your inventory (if ItemSettings.RequireItem = true).

[!IMPORTANT] Mumble/pma-voice must be active (MumbleIsActive() must return true) for the radio to open. If voice is not active, an error message will appear in the chat.

When the radio opens:

  • The player performs a phone animation.
  • A walkie-talkie prop spawns in their hand.
  • The NUI panel slides in.

Connecting to a Channel

  1. Open the radio.
  2. Navigate to the CONNECT tab (the plug icon).
  3. Enter a channel number (any positive integer).
  4. Click Connect.

If the channel is locked (job-restricted):

  • Players with the correct job join immediately.
  • Players without the job but with EnableRequesting = true will have a request sent to the channel members. They will receive a notice that the request was sent.

If the channel has a password:

  • A password dialog appears after clicking Connect.
  • Enter the correct password to join.
  • If you are the first player to join an empty channel, you set the password. All subsequent joiners must use that password until the channel is empty again.

Disconnecting from a Channel

  1. Open the radio.
  2. Click the Disconnect button shown in the connected channel panel.

OR

  • The player will be automatically disconnected if they die and Config.DisableOnDeath = true.

When disconnecting:

  • The radio prop disappears from the player's hand (if AttachPropOnUse = true).
  • Voice is disabled on the channel.
  • Other channel members are notified via the members list refresh.

Managing Channel Passwords

Channel passwords are set automatically when the first player joins a fresh (empty) channel. They are prompted to enter an optional password through the NUI dialog.

  • If a password is entered, all future joiners must provide it.
  • If no password is set (left blank), the channel remains open.
  • When all players leave a channel, the password is automatically cleared.

[!NOTE] Locked/job-restricted channels do not use the password system. They use the job-check and request system instead.


Favorites

Players can save channel numbers to a personal favorites list for quick access:

  1. Open the radio.
  2. Navigate to the FAVORITES tab (star icon).
  3. View saved channels and connect with a single click.

Favorites are stored client-side in the NUI's browser storage (persists across sessions using localStorage).


Viewing Channel Members

When Config.EnableShowUsers = true:

  1. Open the radio while connected to a channel.
  2. Navigate to the CONNECTED tab.
  3. See a list of all players currently on your channel.
  4. The speaking indicator highlights automatically when a member is transmitting (pma-voice integration).

The member list is refreshed server-side whenever someone joins or leaves the channel.


Requesting Access to a Locked Channel

If a player without the required job tries to join a locked channel and Config.EnableRequesting = true:

  1. Player navigates to the Connect tab and enters the locked frequency.
  2. The system detects the restriction and sends a request to all eligible officers on that channel.
  3. The player is shown a message: "Request sent to access this channel."
  4. If an officer accepts, the player can then manually re-join the channel.

Accepting / Declining Access Requests

Players who are on a locked channel AND have a job.grade >= Config.LockedChannels[n].accepterGrade will see incoming requests.

  1. Open the radio.
  2. Navigate to the REQUESTS tab (inbox icon).
  3. View the list of pending requesters (shown with their character name).
  4. Click Accept or Decline for each request.
  • Accepted → The requesting player can now join the channel freely.
  • Declined → The request is removed. The player is not notified.

Setting a Custom Radio Name

Players can replace their character name with a custom alias visible to other channel members:

  1. Open the radio while connected to a channel.
  2. Navigate to the GPS SETTINGS tab (settings icon).
  3. Find the Custom Name section.
  4. Type an alias name and click Confirm.
  5. Click Reset to revert to the original character name.

This name is broadcast to all channel members in real time.


GPS / Volume Settings

In the GPS SETTINGS tab players can:

  • Adjust Sound Level — Controls the radio volume via the voice resource.
  • Adjust GPS Size — Scales the in-world HUD element.
  • Reset Settings — Reverts all settings to their defaults.

Radio License Exam

The radio exam is an in-world system that allows players to "officially" obtain a radio. It is located at the coordinates defined in Config.ExamSettings.Npc.Coords (default: near the LSPD parking area).

Process:

  1. Navigate to the exam location (a map blip will guide you if ExamSettings.Blip.Enable = true).
  2. Approach the NPC examiner.
  3. Interact via the target prompt or the [E] Start Radio Licence Exam 3D prompt.
  4. A confirmation checks your bank balance: if you have at least ExamSettings.ExamPrice ($5,000 default), funds are deducted and the exam begins.
  5. The exam UI opens — answer the multiple-choice questions one by one.
  6. After all questions, if you answered at least QuestionsToPass correctly, the radio:finishExam server callback fires.
  7. Customize this callback in server/open.lua to give the player a radio item, update a database flag, etc.

[!TIP] The exam logic in server/open.lua (radio:finishExam) is intentionally left empty so you can plug in your own inventory reward, database update, or notification logic.


Radio Tower Hacking

A criminal-side activity that allows players to intercept all active radio frequencies currently in use.

Requirements:

  • trojan_usb item in inventory.
  • laptop item in inventory.
  • Be near one of the configured HackingCoordinates locations.

Process:

  1. Go to a hacking location (no blip by default — add one manually if desired).
  2. Interact via the target prompt or [E] Hack The Radio Tower prompt.
  3. A synchronized heist-style animation plays (enter → loop → exit).
  4. During the loop phase, the NUI PinCracker minigame starts and runs for hackTime seconds.
  5. Once cracked, the NUI displays a list of hacked channels — all frequencies that currently have active players on them.
  6. The hacker can click any frequency to listen in (join that channel).
  7. The optional Config.HackDispatch function fires server-side, allowing you to alert police.

📤 Exports

aty_radio exposes the following client-side exports for use in other scripts:

-- Check if the local player is currently in any radio channel
local inChannel = exports["aty_radio"]:IsPlayerInAnyChannel()
-- Returns: boolean

-- Join a radio channel (syncs with voice resource)
exports["aty_radio"]:JoinChannel(channelNumber)
-- channelNumber: integer

-- Leave the current radio channel
exports["aty_radio"]:LeaveChannel(channelNumber)
-- channelNumber: integer (current channel)

-- Set the radio volume
exports["aty_radio"]:SetRadioVolume(volume)
-- volume: number (0.0 - 1.0 for pma-voice / salty-chat)

Example Usage:

-- In another resource, force a player to leave the radio before jailing them
if exports["aty_radio"]:IsPlayerInAnyChannel() then
    exports["aty_radio"]:LeaveChannel(currentChannel)
end

📡 Events Reference

Client Events (Received)

Event Name Description
radio:refreshMembers Fired by server when channel membership changes. Updates the NUI member list.
aty_radio:client:openRadio Fired by server when a player uses the radio item. Opens the UI.
aty_radio:client:onTalk Fired when a channel member starts/stops transmitting. Updates the speaking indicator in the UI.
pma-voice:radioActive Fired by pma-voice when the player toggles their radio transmit key.

Server Events (Received)

Event Name Description
aty_radio:onTalk Fired by client when transmit starts/stops. Broadcasts onTalk to all channel members.
playerDropped Built-in event. Used to clean up channel state when a player disconnects.

🏗️ Script Architecture

aty_radio/
├── fxmanifest.lua          # Resource manifest — declares scripts, files, dependencies
├── shared/
│   ├── config.lua          # All configuration options
│   └── locale.lua          # Localization strings and _L() helper function
├── client/
│   ├── client.lua          # Main client logic: NUI callbacks, prop management, exam/hacking
│   ├── open.lua            # Voice resource integration (join/leave/volume) + death handler
│   └── 3dtext.lua          # vPrompt class — renders 3D world-space prompts as fallback UI
├── server/
│   ├── server.lua          # All server-side callbacks: channel management, requests, custom names
│   └── open.lua            # Item registration, exam finish callback, framework name resolution
└── ui/                     # Pre-built NUI (compiled from web/)
    ├── index.html
    └── assets/
        ├── index-*.js      # Compiled Vue app
        ├── index-*.css     # Compiled styles
        ├── radio-*.png     # Radio background image
        ├── channels-bg-*.png
        ├── page-*.png
        ├── cracker-bg-*.png
        ├── mic_on-*.wav    # Mic activate sound effect
        └── mic_off-*.wav   # Mic deactivate sound effect

[!NOTE] The web/ folder contains the Vue 3 + Vite source code for the NUI. The compiled output is placed in ui/. You do not need to rebuild unless you are modifying the UI. Rebuild with npm run build from the web/ directory.


🖥️ NUI Pages Reference

The NUI is a Vue 3 single-page application with the following sections:

Page / Component Route Description
RadioProp.vue Main view The animated radio device background.
RadioHeader.vue Always visible Shows the current frequency/channel.
RadioNavigation.vue Always visible Tab bar for navigating between pages.
ConnectPage.vue Connect tab Channel number input + connect/disconnect button + password dialog.
FavoritesPages.vue Favorites tab Grid of saved channels. Add/remove from favorites.
RadioMembers.vue Connected tab Members list with talking indicator.
RequestsPage.vue Requests tab Accept/decline access requests for locked channels.
SettingsPage.vue Settings tab Custom name, sound volume, GPS size.
ChannelsMenu.vue Hacked channels overlay Shows intercepted channels after a successful hack.
CodesMenu.vue Cracker overlay PinCracker minigame shown during a hack.
ExamPage.vue Exam overlay Multiple-choice exam UI with progress tracking.

🎙️ Voice Integration

The script auto-detects the active voice resource on the server. It supports three systems:

Voice Resource Join Leave Volume
pma-voice exports["pma-voice"]:setRadioChannel(ch) setRadioChannel(0) setRadioVolume(vol)
mumble-voip exports["mumble-voip"]:SetRadioChannel(ch) SetRadioChannel(0) Not supported
salty-chat exports.saltychat:SetRadioChannel(ch, true) SetRadioChannel('', true) SetRadioVolume(vol)

[!WARNING] Only one voice resource should be running at a time. The script detects resources by checking GetResourceState(). If multiple are running simultaneously, the first detected one (pma-voice → mumble-voip → salty-chat) takes priority.

Transmit Indicator (pma-voice only)

When using pma-voice, the pma-voice:radioActive event is fired automatically when a player presses their PTT key. aty_radio listens to this and broadcasts the talk state to all channel members, updating the talking indicator in the members list.


👨‍💻 Admin / Developer Notes

Changing Exam Questions

Edit the ExamSettings.ExamQuestions table in shared/config.lua. Each entry follows this structure:

{
    question = 'Your question text here?',
    answers = {'Option A', 'Option B', 'Option C', 'Option D'},
    correct = 'Option A'   -- Must exactly match one of the answers
}

Adding More Hacking Locations

Add additional entries to Config.HackingSettings.HackingCoordinates:

{
    coords = vector4(x, y, z, heading),
    hackTime = 20,  -- seconds for the cracking minigame
}

The script will automatically create a target zone or 3D prompt for each location.

Disabling the Exam

If you don't want the license exam feature, set:

ExamSettings = {
    Npc = { Enable = false },
    Blip = { Enable = false },
    -- ...
}

This prevents the NPC from spawning and the blip from appearing. The server-side callback still registers but will never fire.

Giving Items via Events

You can open the radio UI from any other script using:

-- Server-side: open the radio UI for a specific player
TriggerClientEvent("aty_radio:client:openRadio", source)

Finishing the Exam (server/open.lua)

The radio:finishExam callback in server/open.lua is intentionally blank. You must implement the reward logic yourself. Common examples:

Give the radio item (ox_inventory):

modules.RegisterCallback("radio:finishExam", function(src, data)
    exports.ox_inventory:AddItem(src, 'radio', 1)
    TriggerClientEvent("aty_lib:notify", src, "You passed the exam! You received a radio.", "success")
end)

Give the radio item (QBCore):

modules.RegisterCallback("radio:finishExam", function(src, data)
    local Player = QBCore.Functions.GetPlayer(src)
    Player.Functions.AddItem('radio', 1)
    TriggerClientEvent("QBCore:Notify", src, "You passed the radio exam!", "success")
end)

Set a database flag:

modules.RegisterCallback("radio:finishExam", function(src, data)
    local identifier = GetPlayerIdentifier(src, 0)
    MySQL.Async.execute("UPDATE users SET radio_license = 1 WHERE identifier = @id", {
        ['@id'] = identifier
    })
end)

🔧 Troubleshooting

Problem Likely Cause Solution
Radio doesn't open when using item RequireItem = true but item not registered Register item in your inventory resource. Check Config.ItemSettings.Item matches exactly.
"Mumble is not active" in chat Voice resource is not started Ensure pma-voice / mumble-voip / salty-chat is running and fully started.
Channel can't be heard Voice resource mismatch Verify only one voice resource is started. Check open.lua logic if needed.
NPC doesn't appear Wrong coords or ped model name Check Config.ExamSettings.Npc.Coords and that the ped model string is valid.
Hacking prompt not appearing Player is too far from hack point Move within 7.5 units of the location.
Players can't join locked channels Job name mismatch Ensure the job name in LockedChannels[n].jobs exactly matches the framework's job name.
No requests showing for officers Grade check failing Check accepterGrade. Grade 2 means the officer must be at job grade level 2 or above.
Channel password not working Password already cleared The password resets when all players leave. First joiner to a fresh channel sets the new password.
aty_lib not found error Dependency not started Add ensure aty_lib above ensure aty_radio in server.cfg.
Exam questions not appearing ExamQuestions table is empty Add at least QuestionsToPass number of questions to the config.

📝 License

This resource was developed by atiysu. All rights reserved.
Unauthorized redistribution, resale, or modification without permission is prohibited.


Made with ❤️ for FiveM roleplay communities.