GM:PlayerCanHearPlayersVoice

From Garry's Mod
Jump to: navigation, search
 GM:PlayerCanHearPlayersVoice( )

Contents

Description

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

Arguments

Player listener

The listening player.

Arguments

Player talker

The talking player.

Returns

boolean

Return true if the listener should hear the talker, false if they shouldn't.

Returns

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.

Examples

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)


Personal tools
Navigation