Skip to content

Commit 044e646

Browse files
committed
feat(radio): new version changes
1 parent f96403c commit 044e646

File tree

4 files changed

+46
-72
lines changed

4 files changed

+46
-72
lines changed

pages/radio/config.mdx

+38-64
Original file line numberDiff line numberDiff line change
@@ -3,81 +3,48 @@
33
Here you can find detailed description of each config option.
44
Options marked with ✏ symbol automatically overrides the pma-voice convars.
55

6-
## locale
7-
What supported language to use for notifications and UI.
8-
Locale name is the same as the file name in [locales](https://github.com/acscripts/ac_radio/tree/main/locales) folder without the `.lua` extension (eg. **en**, **cs**).
9-
Note that some character sets may not be supported when using the default notifications (eg. `ěčřůďťň`).
10-
Feel free to submit a PR with more languages!
11-
12-
**Accepted values**
13-
`'en'` = Or any other locale.
14-
156

167

17-
## versionCheck
18-
Whether to check for newer resource version and notify in server console.
8+
## useUsableItem
9+
Whether to allow opening the radio UI using an inventory item.
10+
Following the [Installation guide](./install.mdx) is recommended before enabling this option.
1911

2012
**Accepted values**
21-
`true` = You will be notified in server console when a newer version of **ac_radio** is available.
22-
`false` = You will need to manually check for a newer version on GitHub 👎🏽
23-
24-
25-
26-
## useCustomNotify
27-
Whether to use custom notification function located in [utils.lua](https://github.com/acscripts/ac_radio/tree/main/resource/client/utils.lua) in `customNotify`.
28-
If you have [ox_lib](https://github.com/overextended/ox_lib) resource running, you can set this to `true` and not worry about anything else.
29-
Otherwise, you must add your own notification code snippet to the **customNotify** function.
30-
31-
**Accepted values**
32-
`true` = The code inside `customNotify` function will be used instead of the default notification.
33-
`false` = The default GTA V notifications will be used.
13+
`boolean` (true / false)
3414

3515

3616

3717
## useCommand
38-
Whether to use command for opening the radio UI.
18+
Whether to allow opening the radio UI using a command.
3919

4020
**Accepted values**
41-
`true` = A command to open the radio will be created.
42-
`false` = It will only be possible to open the radio UI using an item (if you're using one of the supported frameworks) or using the following snippets.
43-
44-
**Snippets**
45-
```lua copy filename="Your own script"
46-
-- Export
47-
exports.ac_radio:openRadio()
48-
49-
-- Event
50-
TriggerEvent('ac_radio:openRadio')
51-
TriggerClientEvent('ac_radio:openRadio', source)
52-
```
21+
`boolean` (true / false)
5322

5423

5524

5625
## commandKey
5726
Default keybind for the radio command. Use only if the option above (**useCommand**) is set to `true`.
5827

5928
**Accepted values**
60-
`false` = The keybind will not be created at all.
29+
`false` = Keybind will not be created at all.
6130
`''` = Empty quotes for creating the keybind, but not setting a default key.
6231
`'NUMPAD0'` = Or any other [valid key](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard) to create a keybind with **this** default key.
6332

6433

6534

66-
## noRadioDisconnect
67-
Whether to disconnect from radio when there is no radio item in player's inventory.
35+
## disconnectWithoutRadio
36+
Whether to disconnect player from frequency when there is no radio item left in player's inventory.
6837

6938
**Accepted values**
70-
`true` = You will be disconnected from radio when there is no radio item in your inventory.
71-
`false` = You won't.
39+
`boolean` (true / false)
7240

7341

7442

75-
## maximumFrequencies
76-
Maximum number of available channel frequencies.
77-
Frequency range will be **from more than 0 to this value inclusive**.
43+
## volumeStep
44+
Percentage of volume to increase/decrease per step.
7845

7946
**Accepted values**
80-
`number` = Self explanatory.
47+
`number`
8148

8249

8350

@@ -86,30 +53,39 @@ How much the frequency value can change per step.
8653
If set to `0.01`, available frequencies will be **32.56**, **32.57**, **32.58** etc. Can be an integer as well.
8754

8855
**Accepted values**
89-
`number` = Self explanatory.
56+
`number`
57+
58+
59+
60+
## maximumFrequencies
61+
Maximum amount of available frequencies.
62+
Frequency range will be **from more than 0 to this value inclusive**.
63+
64+
**Accepted values**
65+
`number`
9066

9167

9268

9369
## restrictedChannels
94-
In the following text, the term "group" has the same meaning as "job".
95-
Restricts certain channel frequencies for given groups and grades. Each specific frequency must be listed separately.
70+
Restricts certain frequencies for given groups and grades. Each frequency must be listed separately.
9671

9772
**Accepted values**
98-
Table of any amount of frequencies
73+
`table` as following:
74+
9975
```lua
10076
-- Single group without grade (any grade in this group can access it)
10177
[frequency] = 'group'
10278

10379
-- Single group with grade
10480
[frequency] = {
105-
group = grade
81+
group = grade,
10682
}
10783

10884
-- Multiple groups
10985
[frequency] = {
11086
group1 = grade1,
11187
group2 = grade2,
112-
group3 = grade3
88+
group3 = grade3,
11389
}
11490
```
11591

@@ -119,39 +95,37 @@ restrictedChannels = {
11995
[1] = {
12096
police = 5, -- "police" with grade >=5 can access 1 MHz
12197
ambulance = 7, -- "ambulance" with grade >=7 can access 1 MHz
122-
fbi = 0 -- all of "fbi" can access 1 MHz
98+
government = 0, -- all of "government" can access 1 MHz
12399
},
124100
[1.1] = 'police', -- all of "police" can access 1.1 MHz
125101
[1.2] = 'ambulance', -- all of "ambulance" can access 1.2 MHz
126-
[1.3] = 'fbi' -- all of "fbi" can access 1.3 MHz
102+
[1.3] = 'government' -- all of "government" can access 1.3 MHz
127103
}
128104
```
129105

130106

131107

132108
## radioEffect ✏
133-
Whether to enable radio submix effect.
134-
Overrides `voice_useNativeAudio` and `voice_enableSubmix` convars.
109+
Whether to enable radio voice effect. Player voice will sound like on a real radio.
110+
Overrides `voice_useNativeAudio` and `voice_enableSubmix` convars from pma-voice.
135111

136112
**Accepted values**
137-
`true` = People on radio will sound like on real-life radio.
138-
`false` = No additional voice submix will be applied.
113+
`boolean` (true / false)
139114

140115

141116

142117
## radioAnimation ✏
143118
Whether to enable animation while talking on radio.
144-
Overrides `voice_enableRadioAnim` convar.
119+
Overrides `voice_enableRadioAnim` convar from pma-voice.
145120

146121
**Accepted values**
147-
`true` = Your hand will be placed on shoulder while talking on radio.
148-
`false` = Nothing will happen.
122+
`boolean` (true / false)
149123

150124

151125

152126
## radioKey ✏
153-
Whether to enable animation while talking on radio.
154-
Overrides `voice_defaultRadio` convar.
127+
Default keybind for talking on the radio.
128+
Overrides `voice_defaultRadio` convar from pma-voice.
155129

156130
**Accepted values**
157-
`'LMENU'` = Or any other [valid key](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard) to create a keybind with **this** default key.
131+
`string` (any [valid key](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard))

pages/radio/index.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Getting started
22

3-
ac_radio is a framework-standalone user interface for radio control. The only dependency is [pma-voice](https://github.com/AvarianKnight/pma-voice) system.
3+
ac_radio is a framework-standalone user interface for radio control. The only dependencies are [pma-voice](https://github.com/AvarianKnight/pma-voice) and [ox_lib](https://github.com/overextended/ox_lib).
44

5-
You can use any supported framework to enable additional features such as usable item or restrictions. Supported frameworks are [ox_core](https://github.com/overextended/ox_core), [es_extended](https://github.com/esx-framework/esx-legacy) and [qb-core](https://github.com/qbcore-framework/qb-core).
5+
You can use any supported framework to enable additional features such as usable item or restrictions.
6+
Supported frameworks are [ox_core](https://github.com/overextended/ox_core), [qbx_core](https://github.com/Qbox-project/qbx_core), [qb-core](https://github.com/qbcore-framework/qb-core) and [es_extended](https://github.com/esx-framework/esx_core).
67

78
Report bugs using [GitHub issues](https://github.com/acscripts/ac_radio/issues). Use the official [Discord server](https://discord.gg/2ZezMw2xvR) for support.
89

@@ -11,12 +12,9 @@ Report bugs using [GitHub issues](https://github.com/acscripts/ac_radio/issues).
1112
- Channel frequency restrictions for groups/jobs
1213
- Usable item for [ox_inventory](https://github.com/overextended/ox_inventory) and any ESX / QB inventory
1314
- Variable frequency limit and step between them
14-
- Add your own notification system easily
15-
- Detailed config explanation
1615
- Tooltips for individual buttons on the radio
1716
- Buttons for complete volume control (up, down, mute)
1817
- Choose between command and usable item
19-
- Configurable key mapping for command
2018
- Support for custom locales
2119

2220
### Preview

pages/radio/install.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add the following snippet to `ox_inventory/data/items.lua`.
2323
export = 'ac_radio.openRadio',
2424
remove = function(total)
2525
-- Disconnets a player from the radio when all his radio items are removed.
26-
if total < 1 and GetConvar('radio_noRadioDisconnect', 'true') == 'true' then
26+
if total < 1 and GetConvar('radio:disconnectWithoutRadio', 'true') == 'true' then
2727
exports.ac_radio:leaveRadio()
2828
end
2929
end

pages/radio/issues.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ Make sure you have the latest version of all required resources.
77

88
**Downloads**
99
[Latest version of ac_radio](https://github.com/acscripts/ac_radio/releases/latest)
10-
[Latest version of pma-voice](https://github.com/AvarianKnight/pma-voice/releases/latest)
10+
[Latest version of pma-voice](https://github.com/AvarianKnight/pma-voice/releases/latest)
11+
[Latest version of ox_lib](https://github.com/overextended/ox_lib/releases/latest)
1112

1213
## Start order
1314
ac_radio must be started **AFTER** pma-voice and/or any supported framework.
1415

1516
**Recommended order**
1617
```yaml filename="server.cfg"
18+
ensure ox_lib
1719
ensure pma-voice
1820
## Remove the commented lines if you're not using any of them.
19-
# ensure es_extended / qb-core / ox_core
21+
# ensure ox_core / qbx_core / qb-core / es_extended
2022
# ensure ox_inventory
2123
ensure ac_radio
2224
```

0 commit comments

Comments
 (0)