GetElementCollisionsEnabled: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser32 (talk | contribs) No edit summary |
(Fix OOP syntax) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 7: | Line 7: | ||
bool getElementCollisionsEnabled ( element theElement ) | bool getElementCollisionsEnabled ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[element]]:getCollisionsEnabled|collisions|setElementCollisionsEnabled}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theElement:''' The element for which you want to check whether collisions are enabled | *'''theElement:''' The element for which you want to check whether collisions are enabled | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example check if there are any players with collisions disabled. | |||
<syntaxhighlight lang="lua"> | |||
for _,player in ipairs( getElementsByType( "player" ) ) do | |||
if not getElementCollisionsEnabled( player ) then -- If we get a false return from the function, we know that the collisions are disabled. | |||
outputConsole( "Player " .. getPlayerName( player ) .. " has collisions disabled." ) | |||
end | |||
end | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions}} |
Latest revision as of 16:18, 7 November 2018
This function indicates if a specific element is set to have collisions disabled. An element without collisions does not interact with the physical environment and remains static.
Syntax
bool getElementCollisionsEnabled ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getCollisionsEnabled(...)
- Variable: .collisions
- Counterpart: setElementCollisionsEnabled
Required Arguments
- theElement: The element for which you want to check whether collisions are enabled
Returns
Returns true if the collisions are enabled, false otherwise.
Example
This example check if there are any players with collisions disabled.
for _,player in ipairs( getElementsByType( "player" ) ) do if not getElementCollisionsEnabled( player ) then -- If we get a false return from the function, we know that the collisions are disabled. outputConsole( "Player " .. getPlayerName( player ) .. " has collisions disabled." ) 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