isVoiceEnabled | Multi Theft Auto: Wiki Skip to content

isVoiceEnabled

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Added to client side. This function allows you to make the server reveal whether or not voice is currently enabled.

Syntax

isVoiceEnabled ( )

Code Examples

server

This example shows how to forbid use voice for muted (in chat) players

-- only if voice enabled
if isVoiceEnabled() then
-- adding handler for voice start event
addEventHandler( 'onPlayerVoiceStart', root,
function()
-- if player is muted in chat
-- do not broadcast his voice to other players
if isPlayerMuted(source) then cancelEvent() end
end
)
end

See Also