- Documentation
- Shared functions
- isPlayerTalking
Function
isPlayerTalking
Checks whether a player is talking through voice chat right now. On the client, for the local player it means their microphone is transmitting.
Syntax
bool isPlayerTalking(player thePlayer)Arguments
thePlayerplayer- The player.
Returns
true while talking.
Example
for _, p in ipairs(getElementsByType("player")) do
if isPlayerTalking(p) then outputServerLog(getPlayerName(p) .. " mówi") end
end
addEventHandler("onClientRender", root, function()
if isPlayerTalking(localPlayer) then dxDrawText("MIKROFON", 20, 400) end
end)
See also
getPlayerVoiceLevelReturns how loud a player is talking right now:-1when silent, and while talking a level from0(quiet) to3(loud). Useful for your own talk indicators.onPlayerVoiceStartA player started talking through voice chat (start of an utterance). You can block it: then nobody hears this utterance until the player stops talking.