SetPlayerVoiceMode
setPlayerVoiceMode
Changes how the server routes a player's voice packets.
Syntax
bool setPlayerVoiceMode(int playerId, string mode)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
mode |
string |
yes | One of disabled, proximity, channel, or global.
|
Returns
Returns true when the validated mode was accepted; otherwise returns false.
Examples
Enable proximity voice:
setPlayerVoiceMode(playerId, "proximity")
Notes
- Available only in server-side resource scripts.
- Proximity routes to listeners in range, channel routes to the same channel, and global routes to every eligible listener.
- Mode names are case-insensitive.