A snippet for pma-voice that makes you talk on a walkie talkie prop instead of “cb radio”.
HOW TO INSTALL :
Go to pma-voice > client > module > radio.lua
Replace RegisterCommand(‘+radiotalk’, function() with :
RegisterCommand('+radiotalk', function()
if GetConvarInt('voice_enableRadios', 1) ~= 1 then return end
if isDead() or LocalPlayer.state.disableRadio then return end
if not radioPressed and radioEnabled then
if radioChannel > 0 then
logger.info('[radio] Start broadcasting, update targets and notify server.')
playerTargets(radioData, MumbleIsPlayerTalking(PlayerId()) and callData or {})
TriggerServerEvent('pma-voice:setTalkingOnRadio', true)
radioPressed = true
playMicClicks(true)
if GetConvarInt('voice_enableRadioAnim', 0) == 1 and not (GetConvarInt('voice_disableVehicleRadioAnim', 0) == 1 and IsPedInAnyVehicle(PlayerPedId(), false)) and not disableRadioAnim then
RequestAnimDict('ultra@walkie_talkie')
while not HasAnimDictLoaded('ultra@walkie_talkie') do
Wait(10)
end
TaskPlayAnim(PlayerPedId(), "ultra@walkie_talkie", "walkie_talkie", 8.0, 2.0, -1, 50, 2.0, false, false, false)
radioProp = CreateObject(`prop_cs_hand_radio`, 1.0, 1.0, 1.0, 1, 1, 0)
AttachEntityToEntity(radioProp, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 18905), 0.13, 0.02, 0.02, 270.0, 50.0, -5.0, 1, 0, 0, 0, 2, 1)
end
CreateThread(function()
TriggerEvent("pma-voice:radioActive", true)
while radioPressed and not LocalPlayer.state.disableRadio do
Wait(0)
SetControlNormal(0, 249, 1.0)
SetControlNormal(1, 249, 1.0)
SetControlNormal(2, 249, 1.0)
end
end)
end
end
end, false)
Replace RegisterCommand(‘-radiotalk’, function() with :
RegisterCommand('-radiotalk', function()
if (radioChannel > 0 or radioEnabled) and radioPressed then
radioPressed = false
MumbleClearVoiceTargetPlayers(voiceTarget)
playerTargets(MumbleIsPlayerTalking(PlayerId()) and callData or {})
TriggerEvent("pma-voice:radioActive", false)
playMicClicks(false)
if GetConvarInt('voice_enableRadioAnim', 0) == 1 then
StopAnimTask(PlayerPedId(), "ultra@walkie_talkie", "walkie_talkie", 1.0)
ClearPedTasks(PlayerPedId())
if radioProp ~= 0 then
DeleteObject(radioProp)
radioProp = 0
end
end
TriggerServerEvent('pma-voice:setTalkingOnRadio', false)
end
end, false)
enjoy!
ps : you need scully-emotes
if you have questions or problems you can visit : SUPPORT