createWater | Multi Theft Auto: Wiki Skip to content

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 = 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( )
water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height )
setWaterLevel ( height )
end
addEventHandler("onClientResourceStart", resourceRoot, thaResourceStarting)