createWater
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
Creates an area of water.
Note
X and Y positions will be changed to an even integer. i.e. -2, 0, 2, 4 etc.
Important
If you're working with dimensions, be sure to apply it by using setElementDimension .
Syntax
createWater ( )Code Examples
server
Example code for creating a water area to cover the entire San Andreas Map (flood the cities). Also,setWaterLevelis used to raise the existing rivers and lakes.
-- Setting water properties.height = 40SizeVal = 2998-- Defining variables.southWest_X = -SizeValsouthWest_Y = -SizeValsouthEast_X = SizeValsouthEast_Y = -SizeValnorthWest_X = -SizeValnorthWest_Y = SizeValnorthEast_X = SizeValnorthEast_Y = SizeVal
-- OnClientResourceStart function that creates the water.function thaResourceStarting( ) water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height ) setWaterLevel ( height )endaddEventHandler("onClientResourceStart", resourceRoot, thaResourceStarting)