STG ScriptsDocumentation
Radio System V2

Configuration

Every option in STG Radio System V2 config.lua and settings.lua, from opening the radio and job frequencies to jammers, Discord avatars and colours.

Most settings live in stg-radiov2/config.lua. The Discord bot token is in stg-radiov2/settings.lua. Both files stay editable in the escrow version. Restart the resource after a change.

Framework

Config.Framework = "auto"

auto uses qb-core when it is started, otherwise es_extended. Set "esx" or "qb" to force one.

Language

Config.Language = "en"

Available: en, de, fr, es, pt, it, nl, pl, sv, ar, jp, zh, cs. To change a text, edit the matching file in stg-radiov2/locales/. The web part of each file holds the texts on the radio screen.

General

Config.RadioProp = "prop_cs_hand_radio"
Config.ItemName = "radio"
Config.Target = true
Config.ResetRadioCommand = "resetradio"
Config.DeleteEmptyEncryptedChannels = true
Config.DefaultVolume = 100

Prop

Type

Channels are kept in server memory. A resource restart clears every channel, favorites and nicknames stay in the database.

When ox_inventory runs, a player who loses their last radio is disconnected from the channel. This check uses the item name radio in stg-radiov2/client/editable.lua. If you change ItemName, change it there too.

Opening the radio

Config.Use = {
    command = {
        active = true,
        command = "radio",
        needItem = true
    },
    key = {
        active = true,
        key = "F1",
        needItem = true
    },
    item = {
        active = true,
    }
}

Prop

Type

Animation

Config.Animation = {
    dict = "cellphone@",
    name = "cellphone_text_in"
}

Animation the player plays while the radio is open. It stops when the radio is closed.

Job frequencies

Config.SpecialFrequencies = {
    {
        jobs = {"police", "sheriff"},
        frequency = { 1.0, 2.0, 3.0, 4.0, 5.0 },
    },
    {
        jobs = {"ambulance"},
        frequency = { 6.0, 7.0, 8.0, 9.0, 10.0 },
    }
}

Each entry locks a list of frequencies to a list of jobs.

Prop

Type

Players with another job get an error when they try to join, and nobody can create a private channel on these frequencies. Every other frequency is open: typing it joins the channel, or starts a public one if nobody is on it yet.

Jammer

Config.Jammer = {
    active = true,
    item = "jammer",
    place_time = 5000,
    prop = "h4_prop_h4_jammer_01a",
    radius = 30.0,
    max_jammers = 1,

    timeout = {
        active = true,
        duration = 2
    },

    everyone_can_use = true,
    permission = {
        "char1:1007a51229c83570bab9e38191e3ef482fb322d0"
    }
}

Using the jammer item plays a planting animation, places the prop on the ground and removes one item. Anyone inside the radius is disconnected from the radio and sees a no signal screen. Any player can destroy a jammer, from the target eye or by pressing E next to it.

Prop

Type

Discord avatars

Settings = {
    botToken = ""
}

Set in stg-radiov2/settings.lua. With a Discord bot token, the member list shows each player's Discord avatar. Players without a Discord identifier, or with no token set, get the default picture. See the guide to create a Discord bot token.

Colours

The radio colours are in stg-radiov2/html/css/config.css:

:root {
    --main-color: #61EEB1;
    --main-color-2: #EB3F4225;
}
ValueMeaning
--main-colorMain accent colour of the radio.
--main-color-2Second accent colour. Keep the last two digits at 25 (25% opacity).

Notifications

Config.Notify = function(type, message)
    lib.notify({
        title = getMessage('notify_title'),
        description = message,
        type = type
    })
end

Config.HelpNotify = function(message)
    lib.showTextUI(message)
end

Config.HideHelpNotify = function()
    lib.hideTextUI()
end
  • Notify: every radio message. Replace the body to use your own notification system.
  • HelpNotify and HideHelpNotify: the key prompt next to a jammer when Config.Target is false.

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page