OnClientWorldSound: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Redirected page to SetWorldSoundEnabled)
No edit summary
Line 1: Line 1:
#REDIRECT [[setWorldSoundEnabled]]
{{Client event}}
{{Needs_Example}}
__NOTOC__
{{New feature/item|3.0157|1.5.7|14652|
This event triggers whenever a GTA sound starts playing.
}}
{{Note|Use [[setWorldSoundEnabled]] if you want to disable certain sounds conditionless.
For example, you should only cancel player emitted sounds in this event, because when you cancel certain vehicle sounds, the game will try to play the same sound on the next frame.}}
 
==Parameters==
<syntaxhighlight lang="lua">
int group, int index, float x, float y, float z
</syntaxhighlight>
*'''group:''' An [[int|integer]] representing the [[World sound groups|world sound group]]
*'''index:''' An [[int|integer]] representing an individual sound within the group
*'''x:''' a [[float]]ing point number representing the X coordinate on the map.
*'''y:''' a [[float]]ing point number representing the Y coordinate on the map.
*'''z:''' a [[float]]ing point number representing the Z coordinate on the map.
 
==Source==
The source of this event is the element, which emitted the sound.
 
==Cancel effect==
If this event is [[Event system#Canceling|canceled]], the sound won't play at all.
 
==Example==
This page does not have an example.
<syntaxhighlight lang="lua">
-- Add an example here
</syntaxhighlight>
 
==See Also==
===World sound functions===
* [[setWorldSoundEnabled]]
* [[isWorldSoundEnabled]]
* [[resetWorldSounds]]
===Client other events===
{{Client_other_events}}
===Client event functions===
{{Client_event_functions}}

Revision as of 09:16, 28 September 2018

Accessories-text-editor.png Script Example Missing Event OnClientWorldSound needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.


This event triggers whenever a GTA sound starts playing.

[[{{{image}}}|link=|]] Note: Use setWorldSoundEnabled if you want to disable certain sounds conditionless.

For example, you should only cancel player emitted sounds in this event, because when you cancel certain vehicle sounds, the game will try to play the same sound on the next frame.

Parameters

int group, int index, float x, float y, float z
  • group: An integer representing the world sound group
  • index: An integer representing an individual sound within the group
  • x: a floating point number representing the X coordinate on the map.
  • y: a floating point number representing the Y coordinate on the map.
  • z: a floating point number representing the Z coordinate on the map.

Source

The source of this event is the element, which emitted the sound.

Cancel effect

If this event is canceled, the sound won't play at all.

Example

This page does not have an example.

-- Add an example here

See Also

World sound functions

Client other events


Client event functions