Gamemode.PlayerCanHearPlayersVoice
From GMod Wiki
| Event Hook | |
| Hook Name | PlayerCanHearPlayersVoice |
| Syntax | GM:PlayerCanHearPlayersVoice( Player pListener, Player pTalker ) |
| Description | Used to determine if one player can hear another's voice. |
| Returns | Boolean , Boolean |
| Lua State | |
| BBCode | [b][url=wiki.garrysmod.com/?title=Gamemode.PlayerCanHearPlayersVoice]Gamemode.PlayerCanHearPlayersVoice [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
| Description | 3D Voice chat |
|---|---|
| Used on | |
| Code | function GM:PlayerCanHearPlayersVoice() return true, true end |
| Output | Everybody can hear each other depending on how far away they are and their position. |
Additional Notes
- Seems to be called every 7 ticks
- While bots are called for the second argument, they're never called as the first.
- The first player object and the second player object may be the same player, however returning true doesn't seem to emulate voice_loopback 1
- The function will be overridden if sv_alltalk is set to 1.