SetJetpackMaxHeight: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Server client function}} | ||
This function changes the maximum flying height of jetpack. | This function changes the maximum flying height of jetpack. | ||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''Height''': | *'''Height''': The max height starting at approximately -20. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if successful, ''false'' otherwise. | Returns ''true'' if successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This example shows you a command to set your maximum jetpack height. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function setMyMaxHeight ( cmd, value ) | ||
local height = tonumber ( value ) -- Get the number of the value | |||
if height > -20 then -- If the height is higher than -20 | |||
local succes = setJetpackMaxHeight ( height ) -- Set the maximum height | |||
if succes then -- If it's succesfully changed | |||
outputChatBox ( "You've set you maximum jetpack height to "..height.."!", 0, 255, 0 ) -- Send the client a succes message | |||
else -- If there was something wrong | |||
outputChatBox ( "Failed to set your maximum jetpack height to "..height.."!", 255, 0, 0 ) -- Send the client an error message | |||
end | |||
else -- If the given value was below -20 | |||
outputChatBox ( "Failed to change you jetpack height! Please use a number above -20." , 255, 0, 0 ) -- Send the client an error message | |||
end | |||
end | |||
addCommandHandler ( "maxheight", setMyMaxHeight ) -- Add the command handler | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Latest revision as of 16:20, 5 August 2012
This function changes the maximum flying height of jetpack.
Syntax
bool setJetpackMaxHeight ( float Height )
Required Arguments
- Height: The max height starting at approximately -20.
Returns
Returns true if successful, false otherwise.
Example
Click to collapse [-]
ClientThis example shows you a command to set your maximum jetpack height.
function setMyMaxHeight ( cmd, value ) local height = tonumber ( value ) -- Get the number of the value if height > -20 then -- If the height is higher than -20 local succes = setJetpackMaxHeight ( height ) -- Set the maximum height if succes then -- If it's succesfully changed outputChatBox ( "You've set you maximum jetpack height to "..height.."!", 0, 255, 0 ) -- Send the client a succes message else -- If there was something wrong outputChatBox ( "Failed to set your maximum jetpack height to "..height.."!", 255, 0, 0 ) -- Send the client an error message end else -- If the given value was below -20 outputChatBox ( "Failed to change you jetpack height! Please use a number above -20." , 255, 0, 0 ) -- Send the client an error message end end addCommandHandler ( "maxheight", setMyMaxHeight ) -- Add the command handler
See Also
- createSWATRope
- getBirdsEnabled
- getCoronaReflectionsEnabled
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGroundPosition
- getInteriorFurnitureEnabled
- getNearClipDistance
- getPedsLODDistance
- getRoofPosition
- getScreenFromWorldPosition
- getVehiclesLODDistance
- getWorldFromScreenPosition
- isAmbientSoundEnabled
- isLineOfSightClear
- isWorldSoundEnabled
- processLineOfSight
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetNearClipDistance
- resetPedsLODDistance
- resetVehiclesLODDistance
- resetWorldSounds
- setAmbientSoundEnabled
- setBirdsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setNearClipDistance
- setPedsLODDistance
- setVehiclesLODDistance
- setWorldSoundEnabled
- testLineAgainstWater
- 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