CreateWater: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
<syntaxhighlight lang="lua">bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, [bool shallow = false] ) | <syntaxhighlight lang="lua">bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, [bool shallow = false] ) | ||
bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, [bool shallow = false] )</syntaxhighlight> | bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, [bool shallow = false] )</syntaxhighlight> | ||
[[Image:WaterAreas | [[Image:WaterAreas.jpg|thumb|Example of water quadrant.|284x230px]] | ||
===Required Arguments=== | ===Required Arguments=== | ||
For creating a water quadrant: | For creating a water quadrant: |
Revision as of 01:30, 12 February 2009
Creates an area of water.
Syntax
bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, [bool shallow = false] ) bool createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, [bool shallow = false] )
Required Arguments
For creating a water quadrant:
- x1, y1, z1: position of bottom left corner. (south-west)
- x2, y2, z2: position of bottom right corner. (south-east)
- x3, y3, z3: position of top left corner. (north-west)
- x4, y4, z4: position of top right corner. (north-east)
For creating a water triangle:
- x1, y1, z1: position of bottom/top left corner.
- x2, y2, z2: position of bottom/top right corner.
- x3, y3, z3: position of top/bottom corner.
The largest possible size of a water area is 2998×2998.
Optional Arguments
- shallow: makes the water shallow if true. Practically speaking there is no visible water surface in this case, only the splashes when someone walks through it.
Returns
Returns true if successful, false otherwise.
Example
Click to collapse [-]
ClientExample code for creating a water area to cover the entire San Andreas Map. (Flood the cities)
-- Setting water properties. height = 40 SizeVal = 2998 -- Defining variables. southWest_X = -SizeVal southWest_Y = -SizeVal southEast_X = SizeVal southEast_Y = -SizeVal northWest_X = -SizeVal northWest_Y = SizeVal northEast_X = SizeVal northEast_Y = SizeVal -- OnClientResourceStart function that creates the water. function thaResourceStarting( ) outputChatBox("water stuffz created - " .. southEast_X .. "x" .. southEast_X .. " - Height: " .. height .. " - Shallow: False") water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting)
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