GetWaterLevel: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | |||
This function allows you to retrieve water level in a certain position. | This function allows you to retrieve water level in a certain position. | ||
Line 20: | Line 21: | ||
==Example== | ==Example== | ||
<section name="Client" class="Client" show="true"> | |||
This example will tell you what's the water level where the specified player is located. '''NEEDS UPDATING!!!''' | This example will tell you what's the water level where the specified player is located. '''NEEDS UPDATING!!!''' | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 34: | Line 36: | ||
addCommandHandler( "getlevel", scriptGetLevel ) -- add a command "getloc" which | addCommandHandler( "getlevel", scriptGetLevel ) -- add a command "getloc" which | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{World functions}} | {{World functions}} |
Revision as of 14:59, 4 August 2007
This function allows you to retrieve water level in a certain position.
Syntax
bool float getWaterLevel ( float posX, float posY, float posZ, [ bool checkWaves ] )
Required Arguments
- x: The X axis position
- y: The Y axis position
- z: The Z axis position
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- checkWaves: An optional argument to choose if you want to return the height of the waves. ??
Returns
I'm not sure what it must return, all I got was false and 0. ??
Example
Click to collapse [-]
ClientThis example will tell you what's the water level where the specified player is located. NEEDS UPDATING!!!
function scriptGetLevel ( command, playername ) --when getlevel is called local player = getPlayerFromNick ( playername ) --get the player from nickname if ( player ~= false ) then --if there is a player from the nickname local x, y, z = getElementPosition ( player ) -- get his position local bool, level = getWaterLevel ( x, y, z ) outputChatBox ( tostring ( bool ) ) outputChatBox ( level ) else outputChatBox ( "Player does not exist" ) end end addCommandHandler( "getlevel", scriptGetLevel ) -- add a command "getloc" which
See Also
- 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