onPlayerVoiceStart | Multi Theft Auto: Wiki Skip to content

onPlayerVoiceStart

Client-side
Server-side
Shared

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

Parameters

This event does not pass any parameters to the handler function.

Source

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

Canceling

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

Code Examples

server

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