<?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=DakotaReno</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=DakotaReno"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/DakotaReno"/>
	<updated>2026-04-15T07:53:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=33757</id>
		<title>GetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=33757"/>
		<updated>2012-10-16T23:10:40Z</updated>

		<summary type="html">&lt;p&gt;DakotaReno: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Needs Checking|Explain bCheckWaves. --[[User:Winky-|Winky-]] 20:32, 10 August 2012 (UTC)}}&lt;br /&gt;
This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam).&lt;br /&gt;
{{Note|Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getWaterLevel ( float posX, float posY, float posZ [ , bool bCheckWaves = false ] )&lt;br /&gt;
float getWaterLevel ( water theWater )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' The X axis position&lt;br /&gt;
*'''y:''' The Y axis position&lt;br /&gt;
*'''z:''' The Z axis position&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
*'''theWater:''' the water element&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bCheckWaves''' Include the water levels of waves in the ocean, lakes and ...&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''false'' if there's no water in that location or the water level as an ''integer'' if you're near the water (-3 to 20 on the Z coordinate).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will tell you what's the water level where the specified player is located.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptGetLevel ( command, playername ) --when getlevel is called&lt;br /&gt;
  local thePlayer = getPlayerFromName ( playername ) --get the player from nickname&lt;br /&gt;
  if ( thePlayer ~= false ) then --if there is a player from the nickname&lt;br /&gt;
    local x, y, z = getElementPosition ( thePlayer ) -- get his position&lt;br /&gt;
    local level = getWaterLevel ( x, y, z )&lt;br /&gt;
	  if level then -- if it's not false&lt;br /&gt;
        level = z - level -- calculate how far away is he from the water&lt;br /&gt;
        outputChatBox( &amp;quot;You are &amp;quot; .. level .. &amp;quot; units away from the water!&amp;quot;, source )&lt;br /&gt;
	  else outputChatBox ( &amp;quot;There's no sign of water&amp;quot; )&lt;br /&gt;
	  end&lt;br /&gt;
  else outputChatBox ( &amp;quot;Player does not exist&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;getlevel&amp;quot;, scriptGetLevel ) -- add a command &amp;quot;getloc&amp;quot; which&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>DakotaReno</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=33756</id>
		<title>GetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=33756"/>
		<updated>2012-10-16T23:07:38Z</updated>

		<summary type="html">&lt;p&gt;DakotaReno: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Needs Checking|Explain bCheckWaves. --[[User:Winky-|Winky-]] 20:32, 10 August 2012 (UTC)}}&lt;br /&gt;
This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam).&lt;br /&gt;
{{Note|Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getWaterLevel ( float posX, float posY, float posZ [ , bool bCheckWaves = false ] )&lt;br /&gt;
float getWaterLevel ( water theWater )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' The X axis position&lt;br /&gt;
*'''y:''' The Y axis position&lt;br /&gt;
*'''z:''' The Z axis position&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
*'''theWater:''' the water element&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bCheckWaves''' Include water levels of waves in the ocean, lakes and ...&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''false'' if there's no water in that location or the water level as an ''integer'' if you're near the water (-3 to 20 on the Z coordinate).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will tell you what's the water level where the specified player is located.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptGetLevel ( command, playername ) --when getlevel is called&lt;br /&gt;
  local thePlayer = getPlayerFromName ( playername ) --get the player from nickname&lt;br /&gt;
  if ( thePlayer ~= false ) then --if there is a player from the nickname&lt;br /&gt;
    local x, y, z = getElementPosition ( thePlayer ) -- get his position&lt;br /&gt;
    local level = getWaterLevel ( x, y, z )&lt;br /&gt;
	  if level then -- if it's not false&lt;br /&gt;
        level = z - level -- calculate how far away is he from the water&lt;br /&gt;
        outputChatBox( &amp;quot;You are &amp;quot; .. level .. &amp;quot; units away from the water!&amp;quot;, source )&lt;br /&gt;
	  else outputChatBox ( &amp;quot;There's no sign of water&amp;quot; )&lt;br /&gt;
	  end&lt;br /&gt;
  else outputChatBox ( &amp;quot;Player does not exist&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;getlevel&amp;quot;, scriptGetLevel ) -- add a command &amp;quot;getloc&amp;quot; which&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>DakotaReno</name></author>
	</entry>
</feed>