IsVoiceEnabled

From Multi Theft Auto: Wiki

Jump to: navigation, search

FROM VERSION 1.4 r4639 ONWARDS

Added to client side.

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

Syntax

Returns

Returns true if the voice is enabled on the server, false otherwise.

Example

Click to collapse [-]
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

FROM VERSION 1.3.1 r4689 ONWARDS
FROM VERSION 1.3.2 ONWARDS