GetRoofPosition: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.5.8|20675| This function gets the Z level of the lowest roof above a point. It is required that the point is near eno...") |
mNo edit summary |
||
Line 19: | Line 19: | ||
==Example== | ==Example== | ||
This example starts to shake the player's camera if there is no roof over | This example starts to shake the player's camera if there is no roof over him. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setTimer ( | setTimer ( |
Revision as of 21:52, 3 January 2021
This function gets the Z level of the lowest roof above a point. It is required that the point is near enough to the local player so that it's within the area where collision data is loaded.
Syntax
float getRoofPosition ( float x, float y, float z )
Required Arguments
- x: A floating point number representing the X world coordinate of the point.
- y: A floating point number representing the Y world coordinate of the point.
- z: A floating point number representing the Z world coordinate of the point.
Returns
Returns a float with the lowest roof-level Z coord if parameters are valid, false if the point you tried to test is outside the loaded world map.
Example
This example starts to shake the player's camera if there is no roof over him.
setTimer ( function ( ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local roofZ = getRoofPosition ( playerX, playerY, playerZ ) setCameraShakeLevel ( ( roofZ ) and 0 or 255 ) end, 100, 0 )
Requirements
This template will be deleted.
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