How to use SetPedMute (client side mute (VoIP) another player

help

#1

Hi,
I wanna, client side, mute another people.
I found this : http://runtime.fivem.net/doc/reference.html#_0x7A73D05A607734C7
But unable to use it right.

I tried this, but

Citizen.Trace("player " .. i .. " pos " .. GetEntityCoords(GetPlayerPed(i)) .. " muted")
SetPedMute(GetPlayerPed(i))

but got :

[ 1910093] player 1 pos vector3(296.5318, -1448.769, 29.96221) mutedError resuming coroutine: voip.lua:71: attempt to call a nil value (global ‘SetPedMute’)
[ 1910093] stack traceback:
[ 1910093] voip.lua:71: in function voip.lua:31

When invoking native, nothing happens.

Citizen.InvokeNative(0x7A73D05A607734C7,GetPlayerPed(i))

Did I miss something ?


#2

This native is for NPCs, not for Player


#3

:’(
Is there any similar function/event to mute/unmute another player ?


#4

I don’t think so


#5

There are some natives revolved around “voice channels”. I’m not aware of the exact usage/behaviour of these, but I think you can invoke the native NETWORK_SET_VOICE_CHANNEL and set it to an empty channel. I think that will cause voice chat to be disabled (aslong it’s empty).

Other workaround is setting the talkers voice proximity to something very low. (i.e. 0.0001f)
This can be done with the NETWORK_SET_TALKER_PROXIMITY native.


#6

Thanks for your reply, but unfortunately, it’s not what I want :confused:
On client A, I wanna mute client B, but not C, for example. So A will ear only audio from C, even if B is talking (and C will ear A and B, and B will ear A and C)


#7

Yeah that would be tricky. You could do some voice channel voodoo to make that happen.
You could put A and C into channel 1 and B and D in channel 2. But it gets kinda complex when you get to merging room, whom ignores whom :confused:

But that would be server-sided and not client sided (as you stated in topic title),