Skip to content

Commit

Permalink
feat: defaultMicClicks config (#25)
Browse files Browse the repository at this point in the history
* feat: default micClick config

* woops

* add comment

* revert: manifest files
  • Loading branch information
TonybynMp4 authored Feb 7, 2024
1 parent 0796df8 commit 4c4aaff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local radioMenu = false
local onRadio = false
local radioChannel = 0
local radioVolume = 50
local micClicks = true
local micClicks = config.defaultMicClicks

local function connectToRadio(channel)
radioChannel = channel
Expand Down Expand Up @@ -60,6 +60,11 @@ end

exports('IsRadioOn', isRadioOn)

-- Sets mic clicks to the default value when the player logs in.
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
exports['pma-voice']:setVoiceProperty("micClicks", config.defaultMicClicks)
end)

-- Resets state on logout, in case of character change.
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
leaveradio()
Expand Down
3 changes: 3 additions & 0 deletions config/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ return {
---@type number
-- How many decimal places to use for the subchannel.
decimalPlaces = 2,

-- Should the mic clicks be enabled by default
defaultMicClicks = true
}

0 comments on commit 4c4aaff

Please sign in to comment.