Gamemode.PlayerCanHearPlayersVoice

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerCanHearPlayersVoice
SyntaxGM:PlayerCanHearPlayersVoice( Player pListener, Player pTalker )
DescriptionUsed to determine if one player can hear another's voice.
ReturnsBoolean , Boolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerCanHearPlayersVoice]Gamemode.PlayerCanHearPlayersVoice [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionPlayers cannot hear admins talking
Used onNewerServer.png
Code
function GM:PlayerCanHearPlayersVoice( plOne, plTwo )
	return ((plOne:IsAdmin() or !plTwo:IsAdmin()) or (plOne == plTwo))
end
OutputAdmins cannot be heard by other players.


Description3D Voice chat
Used onNewerServer.png
Code
function GM:PlayerCanHearPlayersVoice()
	return true, true
end
OutputEverybody can hear each other depending on how far away they are and their position.

Additional Notes


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox