GetElementInterior: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(11 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | |||
This function allows you to retrieve the interior of any element. An interior is the current loaded place, 0 being outside. | This function allows you to retrieve the interior of any element. An interior is the current loaded place, 0 being outside. | ||
Line 6: | Line 7: | ||
int getElementInterior ( element theElement ) | int getElementInterior ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[element]]:getInterior|interior|setElementInterior}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theElement:''' The element | *'''theElement:''' The element of which you'd like to retrieve the interior | ||
===Returns=== | ===Returns=== | ||
Returns an | Returns an [[int]] for the interior if '''theElement''' is valid, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<section show="true" name="Server" class="server"> | |||
This example shows a player if he is outside or not, when he enters the command 'AmIOutside'. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function AmIOutside ( thePlayer, command ) | |||
if ( getElementInterior(thePlayer) == 0 ) then | |||
outputChatBox ( "Yes you are outside " .. getPlayerName(thePlayer), thePlayer ) | |||
else | |||
outputChatBox ( "No you aren't outside " .. getPlayerName(thePlayer), thePlayer ) | |||
end | |||
end | |||
addCommandHandler ( "AmIOutside", AmIOutside ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions}} | ||
[[de:getElementInterior]] | |||
[[ar:getElementInterior]] |
Latest revision as of 16:13, 17 April 2016
This function allows you to retrieve the interior of any element. An interior is the current loaded place, 0 being outside.
Syntax
int getElementInterior ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getInterior(...)
- Variable: .interior
- Counterpart: setElementInterior
Required Arguments
- theElement: The element of which you'd like to retrieve the interior
Returns
Returns an int for the interior if theElement is valid, false otherwise.
Example
Click to collapse [-]
ServerThis example shows a player if he is outside or not, when he enters the command 'AmIOutside'.
function AmIOutside ( thePlayer, command ) if ( getElementInterior(thePlayer) == 0 ) then outputChatBox ( "Yes you are outside " .. getPlayerName(thePlayer), thePlayer ) else outputChatBox ( "No you aren't outside " .. getPlayerName(thePlayer), thePlayer ) end end addCommandHandler ( "AmIOutside", AmIOutside )
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