Garry's Mod Wiki

GM:PlayerCanHearPlayersVoice

Description

Decides whether a player can hear another player using voice chat.

This hook is called several times a tick, so ensure your code is efficient.

Arguments

1 Player listener
The listening player.
2 Player talker
The talking player.

Returns

1 boolean
Return true if the listener should hear the talker, false if they shouldn't.
2 boolean
3D sound. If set to true, will fade out the sound the further away listener is from the talker, the voice will also be in stereo, and not mono.

Example

Players can only hear each other if they are within 500 units.

hook.Add("PlayerCanHearPlayersVoice", "Maximum Range", function(listener, talker) if listener:GetPos():Distance(talker:GetPos()) > 500 then return false end end)

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 3
Generate Html 9
SaveChanges (1) 8
Render Body 0
Render Sidebar 17