<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MisterQuestions</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MisterQuestions"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/MisterQuestions"/>
	<updated>2026-04-30T06:18:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=53168</id>
		<title>CreateWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=53168"/>
		<updated>2017-12-21T15:39:23Z</updated>

		<summary type="html">&lt;p&gt;MisterQuestions: Added some dot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Creates an area of [[water]].&lt;br /&gt;
&lt;br /&gt;
The largest possible size of a water area is 5996&amp;amp;#0215;5996. Also be aware that the function will change all x and y coordinates you specify into even integer numbers if necessary: this is because of a limitation of San Andreas.&lt;br /&gt;
&lt;br /&gt;
You are able to give the water a shallow water effect, which practically changes the water invisible to the eye. However, all elements still work the same way as without the shallow effect - allowing swimming, diving, vehicles to sink, etc.&lt;br /&gt;
{{Note|X and Y positions will be changed to an even integer. i.e. -2, 0, 2, 4 etc.}}&lt;br /&gt;
{{Important Note|If you're working with dimensions, be sure to apply it by using [[setElementDimension]].}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;water createWater ( int x1, int y1, float z1, int x2, int y2, float z2, int x3, int y3, float z3 [, int x4, int y4, float z4 ] [, bool bShallow = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:WaterAreas.jpg|thumb|Example of water quadrant.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[Water]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x1, y1, z1:''' position of bottom left (south-west) corner.&lt;br /&gt;
*'''x2, y2, z2:''' position of bottom right (south-east) corner.&lt;br /&gt;
*'''x3, y3, z3:''' position of top left (north-west) corner.&lt;br /&gt;
''Note: Only 3 coords creates a triangle''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''x4, y4, z4:''' position of top right (north-east) corner.&lt;br /&gt;
*'''bShallow:''' gives the water a shallow water effect.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a water element if successful, ''false'' otherwise. The water element can be repositioned with [[setElementPosition]] and destroyed with [[destroyElement]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Example code for creating a water area to cover the entire San Andreas Map (flood the cities). Also, [[setWaterLevel]] is used to raise the existing rivers and lakes.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Setting water properties.&lt;br /&gt;
height = 40&lt;br /&gt;
SizeVal = 2998&lt;br /&gt;
-- Defining variables.&lt;br /&gt;
southWest_X = -SizeVal&lt;br /&gt;
southWest_Y = -SizeVal&lt;br /&gt;
southEast_X = SizeVal&lt;br /&gt;
southEast_Y = -SizeVal&lt;br /&gt;
northWest_X = -SizeVal&lt;br /&gt;
northWest_Y = SizeVal&lt;br /&gt;
northEast_X = SizeVal&lt;br /&gt;
northEast_Y = SizeVal&lt;br /&gt;
&lt;br /&gt;
-- OnClientResourceStart function that creates the water.&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height )&lt;br /&gt;
    setWaterLevel ( height )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, thaResourceStarting)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates water at the given coordinates and sets the height of the water level to 20 for when the client joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( 1866, -1444, 10, 1968, -1442, 10, 1866, -1372, 10, 1968, -1370, 10 )&lt;br /&gt;
    setWaterLevel ( water, 20 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), thaResourceStarting)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7542|Water functions in general do not work outside the -3000 -3000 3000 3000 bounds}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>MisterQuestions</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=53167</id>
		<title>CreateWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=53167"/>
		<updated>2017-12-21T15:38:34Z</updated>

		<summary type="html">&lt;p&gt;MisterQuestions: Added some note related to dimensions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Creates an area of [[water]].&lt;br /&gt;
&lt;br /&gt;
The largest possible size of a water area is 5996&amp;amp;#0215;5996. Also be aware that the function will change all x and y coordinates you specify into even integer numbers if necessary: this is because of a limitation of San Andreas.&lt;br /&gt;
&lt;br /&gt;
You are able to give the water a shallow water effect, which practically changes the water invisible to the eye. However, all elements still work the same way as without the shallow effect - allowing swimming, diving, vehicles to sink, etc.&lt;br /&gt;
{{Note|X and Y positions will be changed to an even integer. i.e. -2, 0, 2, 4 etc.}}&lt;br /&gt;
{{Important Note|If you're working with dimensions, be sure to apply it by using [[setElementDimension]]}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;water createWater ( int x1, int y1, float z1, int x2, int y2, float z2, int x3, int y3, float z3 [, int x4, int y4, float z4 ] [, bool bShallow = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:WaterAreas.jpg|thumb|Example of water quadrant.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[Water]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x1, y1, z1:''' position of bottom left (south-west) corner.&lt;br /&gt;
*'''x2, y2, z2:''' position of bottom right (south-east) corner.&lt;br /&gt;
*'''x3, y3, z3:''' position of top left (north-west) corner.&lt;br /&gt;
''Note: Only 3 coords creates a triangle''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''x4, y4, z4:''' position of top right (north-east) corner.&lt;br /&gt;
*'''bShallow:''' gives the water a shallow water effect.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a water element if successful, ''false'' otherwise. The water element can be repositioned with [[setElementPosition]] and destroyed with [[destroyElement]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Example code for creating a water area to cover the entire San Andreas Map (flood the cities). Also, [[setWaterLevel]] is used to raise the existing rivers and lakes.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Setting water properties.&lt;br /&gt;
height = 40&lt;br /&gt;
SizeVal = 2998&lt;br /&gt;
-- Defining variables.&lt;br /&gt;
southWest_X = -SizeVal&lt;br /&gt;
southWest_Y = -SizeVal&lt;br /&gt;
southEast_X = SizeVal&lt;br /&gt;
southEast_Y = -SizeVal&lt;br /&gt;
northWest_X = -SizeVal&lt;br /&gt;
northWest_Y = SizeVal&lt;br /&gt;
northEast_X = SizeVal&lt;br /&gt;
northEast_Y = SizeVal&lt;br /&gt;
&lt;br /&gt;
-- OnClientResourceStart function that creates the water.&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height )&lt;br /&gt;
    setWaterLevel ( height )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, thaResourceStarting)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates water at the given coordinates and sets the height of the water level to 20 for when the client joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( 1866, -1444, 10, 1968, -1442, 10, 1866, -1372, 10, 1968, -1370, 10 )&lt;br /&gt;
    setWaterLevel ( water, 20 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), thaResourceStarting)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7542|Water functions in general do not work outside the -3000 -3000 3000 3000 bounds}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>MisterQuestions</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element&amp;diff=53164</id>
		<title>Element</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element&amp;diff=53164"/>
		<updated>2017-12-21T06:01:58Z</updated>

		<summary type="html">&lt;p&gt;MisterQuestions: The water is an element but isn't listed here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|Water must be considered as an element}}&lt;br /&gt;
&lt;br /&gt;
An '''element''' is a generic class that can represent almost all in-game [[entity|entities]]. The built-in element types are:&lt;br /&gt;
&lt;br /&gt;
{{Elements}}&lt;br /&gt;
&lt;br /&gt;
Any other element type can be created as an abstract element, not referring to any game [[entity]]. For example, '''resource''' and '''map''' elements are created when resources and maps are loaded to group entities they create as their children.&lt;br /&gt;
&lt;br /&gt;
Elements share common functions such as type and list retrieval, a destroy operation to remove both the element and the game entity it is linked to (except for some elements which can't be destroyed, for example client elements), [[element data]] storing and retrieval, and many more common operations.&lt;br /&gt;
&lt;br /&gt;
All elements are stored internally in a [[Element tree|tree structure]], and as such every element except the '''root''' element has a parent element, that can be the '''root''' element, a '''resource''', '''map''' or another element. This is purely for declaring the scope of function calls.&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
===Client===&lt;br /&gt;
{{Client element functions}}&lt;br /&gt;
===Server===&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[it:Elemento]]&lt;br /&gt;
[[ru:Element]]&lt;br /&gt;
[[es:Elemento]]&lt;/div&gt;</summary>
		<author><name>MisterQuestions</name></author>
	</entry>
</feed>