- Documentation
- Server events
- onPlayerVoiceStart
Event
onPlayerVoiceStart
A player started talking through voice chat (start of an utterance). You can block it: then nobody hears this utterance until the player stops talking.
Handler
addEventHandler("onPlayerVoiceStart", root, function() ... end)Source
source is the player.
cancelEvent() blocks this utterance for everyone.
Example
addEventHandler("onPlayerVoiceStart", root, function()
if isPedDead(source) then cancelEvent() end
end)
See also
onPlayerVoiceStopA player stopped talking through voice chat. It also happens when the player's voice stopped arriving (e.g. a lost connection). It does not happen for an utterance blocked inonPlayerVoiceStart.isPlayerTalkingChecks whether a player is talking through voice chat right now. On the client, for the local player it means their microphone is transmitting.setPlayerVoiceMutedMutes or unmutes a player in voice chat. A muted player's voice is not sent to anyone. Muting set with this function takes priority overmutedByDefaultin the server settings.