GetElementDimension
Jump to navigation
Jump to search
This function allows you to retrieve the dimension of any element. The dimension determines what/who the element is visible to.
Syntax
int getElementDimension ( element theElement )
Required Arguments
- theElement: The element in which you'd like to retrieve the dimension of.
Returns
Returns an integer for the dimension if 'theElement' is valid, 'false' otherwise.
Example
addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) function onPlayerEnterVehicle ( theVehicle, seat, jacked ) if ( getElementDimension ( source ) == 0 ) then -- if the player is in dimension 0 setElementDimension ( source, 1 ) -- set his dimension to 1 setElementDimension ( theVehicle, 1 ) -- set his vehicle's dimension to 1 aswell end end addEventHandler ( "onPlayerExitVehicle", root, "onPlayerExitVehicle" ) function onPlayerExitVehicle ( theVehicle, seat, jacker ) if ( getElementDimension ( source ) == 1 ) then -- if the player is in dimension 1 setElementDimension ( source, 0 ) -- set his dimension back to 0 setElementDimension ( theVehicle, 1 ) -- set his vehicle's dimension back to 0 aswell end end
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement