GetGarageSize: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
{{client function}} | {{client function}} | ||
This function outputs the size of garage. | This function outputs the size of garage. | ||
{{Tip|You can use the useful function [[CreateGarageColShape]] to create the garage colshape.}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 12: | Line 12: | ||
===Returns=== | ===Returns=== | ||
Returns three ''float''s indicating the size of the garage. | Returns three ''float''s indicating the size of the garage, false if an invalid garageID has been provided. | ||
{{Note|The values returned by this function are sizeZ, sizeX and sizeY respectively.<br>Also, sizeZ considers the garage Z position equal to 0.}} | |||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This example adds the command /garagesize <garage ID> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | addCommandHandler ( "garagesize", | ||
function ( commandName, garageID ) | |||
local garageID = tonumber ( garageID ) -- We convert the garage ID string to a number. | |||
if ( garageID ) then -- We check if garage ID is valid. | |||
if ( garageID >= 0 and garageID < 50 ) then -- We check if the garage ID is 0 and lower than 50 ( there's only 49 garages ). | |||
local z, x, y = getGarageSize ( garageID ) | |||
if ( x and y and z ) then -- If x and y and z is valid. | |||
-- We output the returned values. | |||
outputChatBox ( "X: ".. x ) | |||
outputChatBox ( "Y: ".. y ) | |||
outputChatBox ( "Z: ".. z ) | |||
else | |||
outputChatBox ( "X, Y, Z values not valid" ) | |||
end | |||
else | |||
outputChatBox ( "Garage ID must be from 0 to 49." ) | |||
end | |||
else | |||
outputChatBox ( "You must write a garage ID" ) | |||
end | |||
end | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
Line 24: | Line 46: | ||
==See Also== | ==See Also== | ||
{{Client world functions}} | {{Client world functions}} | ||
Latest revision as of 06:04, 3 March 2023
This function outputs the size of garage.
Tip: You can use the useful function CreateGarageColShape to create the garage colshape. |
Syntax
float, float, float getGarageSize ( int garageID )
Required Arguments
- garageID: The garage ID that represents the garage door that is being checked.
Returns
Returns three floats indicating the size of the garage, false if an invalid garageID has been provided.
Example
Click to collapse [-]
ClientThis example adds the command /garagesize <garage ID>
addCommandHandler ( "garagesize", function ( commandName, garageID ) local garageID = tonumber ( garageID ) -- We convert the garage ID string to a number. if ( garageID ) then -- We check if garage ID is valid. if ( garageID >= 0 and garageID < 50 ) then -- We check if the garage ID is 0 and lower than 50 ( there's only 49 garages ). local z, x, y = getGarageSize ( garageID ) if ( x and y and z ) then -- If x and y and z is valid. -- We output the returned values. outputChatBox ( "X: ".. x ) outputChatBox ( "Y: ".. y ) outputChatBox ( "Z: ".. z ) else outputChatBox ( "X, Y, Z values not valid" ) end else outputChatBox ( "Garage ID must be from 0 to 49." ) end else outputChatBox ( "You must write a garage ID" ) end end )
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