[Release] mumble-voip, rp-radio

To make frequency 1-4 private you either use the export exports["rp-radio"]:AddPrivateFrequency or in the rp-radio config edit radioConfig.Frequency.Private and change it to:

Private = {
 [1] = true,
 [2] = true,
 [3] = true,
 [4] = true,
}

^ This will make 1-4 private by default

To add ems & cops to those 4 frequencies use:
exports["rp-radio"]:GivePlayerAccessToFrequencies(1, 2, 3, 4) when they go on duty
and use exports["rp-radio"]:RemovePlayerAccessToFrequencies(1, 2, 3, 4) when they go off duty

1 Like

maybe step outside your mind for a second and actually look for something

no native codegen for them yet but they exist and should be usable

old code sample:

local n = setmetatable({}, {
    __index = function(t, k)
        return function(...)
            return Citizen.InvokeNative(GetHashKey(k) & 0xFFFFFFFF, ...)
        end
    end
})

local r = n.GET_AUDIOCONTEXT_FOR_CLIENT(1, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
local s = n.AUDIOCONTEXT_GET_SOURCE(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
local d = n.AUDIOCONTEXT_GET_DESTINATION(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())

n.AUDIOCONTEXT_DISCONNECT(r, d, s, 0, 0)

Wait(0)

local function makeObject(data)
    local d = msgpack.pack(data)

    return string.pack('<T', #d) .. d
end

local curve = {}
local k = 400

local deg = math.pi / 180

for i = 1, 48000 do
    local x = (i - 1) * 2 / 48000 - 1;
    curve[i] = ( 3 + k ) * x * 20 * deg / ( math.pi + k * math.abs(x) );
end

bfn = n.AUDIOCONTEXT_CREATE_WAVESHAPERNODE(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
n.WAVESHAPERNODE_SET_CURVE(bfn, makeObject(curve))

n.AUDIOCONTEXT_CONNECT(r, bfn, s, 0, 0)
n.AUDIOCONTEXT_CONNECT(r, d, bfn, 0, 0)
1 Like

you can make it an item using this event or export [Release] mumble-voip, rp-radio

I have no intention of changing the radio-ui to html, you can probably easily convert any ther radio script to work with mumble-voip

1 Like

Thanks for the example, and i’m horrible at β€œlooking” for things.

Hello, I would like to change the z key with the F1 key to change the voice range how do I do?
When I put F1 nothing happens and it’s always with the z key

perfect, thank you so much for this quick response @Frazzle
Have a nice (coding i presume) day :wink:

https://github.com/FrazzIe/mumble-voip/blob/master/config.lua#L18 change it to 288 ? also make sure INPUT_REPLAY_START_STOP_RECORDING in your keybinds is bound to F1?

Thanks, I had a different version with the keys than the one with the numbers

Hey man ty for such release. I hear other people turn on radio but i dont hear them talking what to do?

Is there any way to enable 3d voice

i have…

setr voice_useSendingRangeOnly true
setr voice_use3dAudio true

in my cfg but the voice is still mono

LG and this is an awesome release tyvm

I use MumbleSetVolumeOverride for setting a players volume which β€œOverrides the output volume for a particular player on Mumble. This will also bypass 3D audio and distance calculations.”

1 Like

Is there any way to use 3d audio or any updates planned to use this feature?

no idea tbh, not rly sure why changing a players volume bypasses 3d audio.

1 Like

because it’s meant to be used for phone call scenarios etc.

if you want to keep 3d audio bits, just use channels and targets for selecting players

2 Likes

That makes more sense, i’ll try see if i can make it work using the target system and only override for phone calls, radio etc

where to put

To add ems & cops to those 4 frequencies use:
exports["rp-radio"]:GivePlayerAccessToFrequencies(1, 2, 3, 4) when they go on duty
and use exports["rp-radio"]:RemovePlayerAccessToFrequencies(1, 2, 3, 4) when they go off duty

These?

2 Likes

in your ems/cop script , trigger them after they go on/off duty

client or server?

1 Like

client

can you tell me where to put i am totally confused