Skip to content

Commit

Permalink
feat(config): Add options for pma-voice convars
Browse files Browse the repository at this point in the history
Spuds can easily edit radio related convars from pma-voice.
  • Loading branch information
antond15 committed Jul 23, 2022
1 parent 4fd448e commit d6c5f07
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
13 changes: 12 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,16 @@ ac = {
-- Channel frequency restrictions.
restrictedChannels = {
[1] = 'police'
}
},

-- ! The following options will override the pma-voice convars.
-- Whether to enable radio submix (voice sounds like on real radio).
radioEffect = true,

-- Whether to enable animation while talking on radio.
radioAnimation = true,

-- Default keybind for talking on radio.
radioKey = 'LMENU',

}
35 changes: 34 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Config explanation
In this file you can find more detailed description of each config option.
In this file you can find more detailed description of each config option.
Options marked with ✏ symbol automatically overrides the pma-voice convars.

<details>
<summary><b>Quick navigation</b></summary>
Expand All @@ -12,6 +13,9 @@ In this file you can find more detailed description of each config option.
- [maximumFrequencies](#maximumfrequencies)
- [frequencyStep](#frequencystep)
- [restrictedChannels](#restrictedchannels)
- [radioAnimation](#radioAnimation)
- [radioEffect](#radioEffect)
- [radioKey](#radioKey)
</details>

<br>
Expand Down Expand Up @@ -131,3 +135,32 @@ restrictedChannels = {
[1.3] = 'fbi' -- Everyone with group "fbi" can access 1.3 MHz
}
```



## radioEffect ✏
Whether to enable radio submix effect.
Overrides `voice_useNativeAudio` and `voice_enableSubmix`.

**Accepted values**
`true` = People on radio will sound like on real-life radio.
`false` = No additional voice submix will be applied.



## radioAnimation ✏
Whether to enable animation while talking on radio.
Overrides `voice_enableRadioAnim`.

**Accepted values**
`true` = Your hand will be placed on shoulder while talking on radio.
`false` = Nothing will happen.



## radioKey ✏
Whether to enable animation while talking on radio.
Overrides `voice_defaultRadio`.

**Accepted values**
`'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.
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lua54 'yes'

name 'ac_radio'
author 'ANTOND.#8507'
version '1.0.5'
version '1.0.6'
description 'A framework-standalone radio UI for FiveM'
repository 'https://github.com/antond15/ac_radio'

Expand Down
7 changes: 7 additions & 0 deletions resource/server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ for frequency, allowed in pairs(ac.restrictedChannels) do
return false
end)
end



SetConvarReplicated('voice_useNativeAudio', tostring(ac.radioEffect))
SetConvarReplicated('voice_enableSubmix', ac.radioEffect and '1' or '0')
SetConvarReplicated('voice_enableRadioAnim', ac.radioAnimation and '1' or '0')
SetConvarReplicated('voice_defaultRadio', ac.radioKey)

0 comments on commit d6c5f07

Please sign in to comment.