Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: switch to native audio #19

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ local function connectToRadio(channel)
else
onRadio = true
exports['pma-voice']:setVoiceProperty('radioEnabled', true)
qbx.playAudio({
audioName = 'Start_Squelch',
audioRef = 'CB_RADIO_SFX',
source = cache.ped
})
end
exports['pma-voice']:setRadioChannel(channel)
if channel % 1 > 0 then
Expand All @@ -22,12 +27,12 @@ local function connectToRadio(channel)
end
end

local function closeEvent()
TriggerEvent('InteractSound_CL:PlayOnOne','click',0.6)
end

local function leaveradio()
closeEvent()
qbx.playAudio({
audioName = 'End_Squelch',
audioRef = 'CB_RADIO_SFX',
source = cache.ped
})
radioChannel = 0
onRadio = false
exports['pma-voice']:setRadioChannel(0)
Expand Down
Loading