SetPlayerVoiceEnabled
Jump to navigation
Jump to search
setPlayerVoiceEnabled
Enables or disables voice transmission for a connected player.
Syntax
bool setPlayerVoiceEnabled(int playerId, bool enabled)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
enabled |
bool |
yes | Whether the player may transmit voice. |
Returns
Returns true when the state was accepted; otherwise returns false.
Examples
Disable outgoing voice:
setPlayerVoiceEnabled(playerId, false)
Notes
- Available only in server-side resource scripts.
- Disabling voice stops relay immediately and ends active speaking state.