SetWaterColor
Jump to navigation
Jump to search
This function changes the water color of the GTA world.
Syntax
bool setWaterColor ( int red, int blue, int green, [ int alpha = 200 ] )
Required Arguments
- red: The red value of the water, from 0 to 255.
- green: The green value of the water, from 0 to 255.
- blue: The blue value of the water, from 0 to 255.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- alpha: The alpha (visibility) value of the water, from 0 to 255. Defaults to 200 if not declared.
Returns
Returns true if water color was set correctly, false if invalid values were passed.
Example
This example adds a command watercolor with which a player can change the water colour.
function changeWaterColor ( commandName, red, green, blue, alpha ) -- if alpha is input, then include it too alpha = alpha or 200 -- check if the colour values for red, green and blue are valid if tonumber ( red ) and tonumber ( green ) and tonumber ( blue ) then setWaterColor ( red, green, blue, alpha ) else outputChatBox ( "Failed to change the water colour!" ) end end addCommandHandler ( "watercolor", changeWaterColor )
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