OnPlayerVoiceStart

From Multi Theft Auto: Wiki
Revision as of 03:03, 27 September 2018 by Botder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: This event should only be used as a low-level function for advanced users. For typical Voice scripting, please see the Voice Resource

This event is triggered when a player starts talking through voice chat.

Parameters

No parameters.

Source

The source of this event is the player element that just started talking through voice chat.

Cancel effect

If this event is canceled the player will not broadcast his voice chat to anyone in the server.

Example

This example shows how to forbid use voice for not logged in players

addEventHandler( 'onPlayerVoiceStart', root,
    function()
        -- if player is not logged in
        -- do not broadcast his voice to other players
        if isGuestAccount( getPlayerAccount(source) ) then
            cancelEvent()
        end
    end
)

See Also

Player events


Event functions