OnClientWorldSound

From Multi Theft Auto: Wiki
Revision as of 06:12, 10 May 2012 by Ccw (talk | contribs) (Created page with "__NOTOC__ {{Client event}} This event is triggered whenever a world sound is played. A world sound is a sound effect which has not been caused by playSound or [[playSound3D]...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered whenever a world sound is played. A world sound is a sound effect which has not been caused by playSound or playSound3D.

Parameters

int group, int index
  • group: An integer representing the world sound group
  • index: An integer representing an individual sound within the group

Source

The source of this event is the root element

Cancel effect

If this event is canceled, then the sound will not be played.

Example

This example prints the world sound group and index in the chat box, and stops all world sound effects in group 5

function handleOnClientWorldSound( group, index )
    outputChatBox( "World sound group:" .. group .. ", index:" .. index )
    if group == 5 then
	cancelEvent() -- Don't play this
    end
end
addEventHandler ( "onClientWorldSound", getRootElement(), handleOnClientWorldSound)

Requirements

This template will be deleted.

See Also

Client sound events