This commit is contained in:
2026-07-07 21:08:52 +02:00
commit 4c20cfc716
2613 changed files with 318021 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
local callChannel = 0
RegisterNetEvent('pma-voice:syncCallData', function(callTable, channel)
callData = callTable
handleRadioAndCallInit()
end)
RegisterNetEvent('pma-voice:addPlayerToCall', function(plySource)
toggleVoice(plySource, true, 'call')
callData[plySource] = true
end)
RegisterNetEvent('pma-voice:removePlayerFromCall', function(plySource)
if plySource == playerServerId then
for tgt, _ in pairs(callData) do
if tgt ~= playerServerId then
toggleVoice(tgt, false, 'call')
end
end
callData = {}
MumbleClearVoiceTargetPlayers(voiceTarget)
addVoiceTargets((radioPressed and isRadioEnabled()) and radioData or {}, callData)
else
callData[plySource] = nil
toggleVoice(plySource, radioData[plySource], 'call')
if MumbleIsPlayerTalking(PlayerId()) then
MumbleClearVoiceTargetPlayers(voiceTarget)
addVoiceTargets((radioPressed and isRadioEnabled()) and radioData or {}, callData)
end
end
end)
function setCallChannel(channel)
if GetConvarInt('voice_enableCalls', 1) ~= 1 then return end
TriggerServerEvent('pma-voice:setPlayerCall', channel)
callChannel = channel
sendUIMessage({
callInfo = channel
})
end
exports('setCallChannel', setCallChannel)
exports('SetCallChannel', setCallChannel)
exports('addPlayerToCall', function(_call)
local call = tonumber(_call)
if call then
setCallChannel(call)
end
end)
exports('removePlayerFromCall', function()
setCallChannel(0)
end)
RegisterNetEvent('pma-voice:clSetPlayerCall', function(_callChannel)
if GetConvarInt('voice_enableCalls', 1) ~= 1 then return end
callChannel = _callChannel
end)