IsAmbientSoundEnabled: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 13: | Line 13: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the ambient sound is enabled, ''false'' if it is disabled or invalid values were passed. | Returns ''true'' if the ambient sound is enabled, ''false'' if it is disabled or invalid values were passed. | ||
===Example=== | |||
This command checks if the type of ambient sound is enabled or not. | |||
/check <type> | |||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("check",function(_,_type) | |||
if isAmbientSoundEnabled(_type) then | |||
outputChatBox(_type.." is enabled!",0,255,0) | |||
else | |||
outputChatBox(_type.." is disabled!",255,0,0) | |||
end | |||
end) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Client | {{Client world functions}} |
Latest revision as of 09:13, 12 July 2017
This function allows you to check if some background sound effects are enabled.
Syntax
bool isAmbientSoundEnabled( string theType )
Required Arguments
- theType: The type of ambient sound to test. Can be either "gunfire" or "general".
Returns
Returns true if the ambient sound is enabled, false if it is disabled or invalid values were passed.
Example
This command checks if the type of ambient sound is enabled or not. /check <type>
addCommandHandler("check",function(_,_type) if isAmbientSoundEnabled(_type) then outputChatBox(_type.." is enabled!",0,255,0) else outputChatBox(_type.." is disabled!",255,0,0) end end)
See Also
- createSWATRope
- getBirdsEnabled
- getCoronaReflectionsEnabled
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGroundPosition
- getInteriorFurnitureEnabled
- getNearClipDistance
- getPedsLODDistance
- getRoofPosition
- getScreenFromWorldPosition
- getVehiclesLODDistance
- getWorldFromScreenPosition
- isAmbientSoundEnabled
- isLineOfSightClear
- isWorldSoundEnabled
- processLineOfSight
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetNearClipDistance
- resetPedsLODDistance
- resetVehiclesLODDistance
- resetWorldSounds
- setAmbientSoundEnabled
- setBirdsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setNearClipDistance
- setPedsLODDistance
- setVehiclesLODDistance
- setWorldSoundEnabled
- testLineAgainstWater
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel