I will leave the solution that my solution, the one that worked for me about GCPHONE.
this is a momentary solution, since the problem comes from the native “NetworkSetVoiceChannel”, when executing the native one at the same time, it only changes the channel to the first execution. To solve this problem, we must give it time to execute the second and not at the same time.
GO FOR IT:
gcphone/server/server.lua line > 450 or function “RegisterServerEvent(‘gcPhone:acceptCall’)”
RegisterServerEvent('gcPhone:acceptCall')
AddEventHandler('gcPhone:acceptCall', function(infoCall, rtcAnswer)
local id = infoCall.id
if AppelsEnCours[id] ~= nil then
if PhoneFixeInfo[id] ~= nil then
onAcceptFixePhone(source, infoCall, rtcAnswer)
return
end
AppelsEnCours[id].receiver_src = infoCall.receiver_src or AppelsEnCours[id].receiver_src
if AppelsEnCours[id].transmitter_src ~= nil and AppelsEnCours[id].receiver_src~= nil then
AppelsEnCours[id].is_accepts = true
AppelsEnCours[id].rtcAnswer = rtcAnswer
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].transmitter_src, AppelsEnCours[id], true)
SetTimeout(1000, function()
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].receiver_src, AppelsEnCours[id], false)
saveAppels(AppelsEnCours[id])
end)
end
end
end)
Line 620 to 636
function onAcceptFixePhone(source, infoCall, rtcAnswer)
local id = infoCall.id
AppelsEnCours[id].receiver_src = source
if AppelsEnCours[id].transmitter_src ~= nil and AppelsEnCours[id].receiver_src~= nil then
AppelsEnCours[id].is_accepts = true
AppelsEnCours[id].forceSaveAfter = true
AppelsEnCours[id].rtcAnswer = rtcAnswer
PhoneFixeInfo[id] = nil
TriggerClientEvent('gcPhone:notifyFixePhoneChange', -1, PhoneFixeInfo)
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].transmitter_src, AppelsEnCours[id], true)
SetTimeout(1000, function()
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].receiver_src, AppelsEnCours[id], false)
saveAppels(AppelsEnCours[id])
end)
end
end