GetElementInterior: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This example shows a player if he is outside or not, when he enters the command 'AmIOutside'. | This example shows a player if he is outside or not, when he enters the command 'AmIOutside'. | ||
<section show="true" name="Server" class="server"> | |||
''This example will not work as it is in a Clientside script, due to different Event names or slightly different syntax.'' | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function AmIOutside ( player, command ) | function AmIOutside ( player, command ) | ||
Line 26: | Line 28: | ||
addCommandHandler ( "AmIOutside", AmIOutside ) | addCommandHandler ( "AmIOutside", AmIOutside ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions}} |
Revision as of 21:54, 4 August 2007
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 )
Required Arguments
- theElement: The element in which you'd like to retrieve the interior of.
Returns
Returns an integer for the interior if 'theElement' is valid, false otherwise.
Example
This example shows a player if he is outside or not, when he enters the command 'AmIOutside'.
Click to collapse [-]
ServerThis example will not work as it is in a Clientside script, due to different Event names or slightly different syntax.
function AmIOutside ( player, command ) if ( getElementInterior(player) == 0 ) then outputChatBox ( "Yes you are outside " .. getClientName(player), player ) else outputChatBox ( "No you aren't outside " .. getClientName(player), player ) 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