onClientSoundStarted | Multi Theft Auto: Wiki Skip to content

onClientSoundStarted

Client-side
Server-side
Shared

This event is triggered when a sound is started.

Parameters

string reason
  • reason: the reason the sound was started, can be "play", "resumed" or "enabled".

Source

element: The source of this event is the sound's element.

Code Examples

client

This example outputs the reason the sound started .

function onSoundStarted ( reason )
if ( reason == "play" ) then
outputChatBox ( "sound started" )
elseif ( reason == "resumed" ) then
outputChatBox ( "sound resumed" )
end
end
addEventHandler ( "onClientSoundStarted", getRootElement(), onSoundStarted )