SetElementInterior: Difference between revisions
Jump to navigation
Jump to search
m (seperated & corrected example) |
No edit summary |
||
Line 13: | Line 13: | ||
===Returns=== | ===Returns=== | ||
Returns 'true' if 'theElement' and 'interior' are valid arguments, 'false' otherwise. | Returns ''true'' if '''theElement''' and '''interior''' are valid arguments, ''false'' otherwise. | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
* '''x''' | * '''x:''' A floating point number representing the X coordinate on the map. | ||
* '''y''' | * '''y:''' A floating point number representing the Y coordinate on the map. | ||
* '''z''' | * '''z:''' A floating point number representing the Z coordinate on the map. | ||
==Example== | ==Example== | ||
Line 25: | Line 25: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function interior ( source, commandName, interior ) | function interior ( source, commandName, interior ) | ||
-- | --Let's see if they gave an interior ID | ||
if ( interior == "1" ) then | if ( interior == "1" ) then | ||
--They did, so lets assign them to that interior and teleport them there (all in 1 function call!) | --They did, so lets assign them to that interior and teleport them there (all in 1 function call!) | ||
setElementInterior ( source, interior, 2233.91, 1714.73, 1011.38 ) | setElementInterior ( source, interior, 2233.91, 1714.73, 1011.38 ) | ||
else | else | ||
--They | --They didn't give one, so set them to the interior they wanted, but don't teleport them. | ||
setElementInterior ( source, interior ) | setElementInterior ( source, interior ) | ||
end | end | ||
Line 42: | Line 42: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function interior ( commandName, interior ) | function interior ( commandName, interior ) | ||
-- | --Let's see if they gave a interior ID | ||
if ( interior == "1" ) then | if ( interior == "1" ) then | ||
--They did, so | --They did, so let's assign them to that interior and teleport them there (all in 1 function call!) | ||
setElementInterior ( getLocalPlayer(), interior, 2233.91, 1714.73, 1011.38 ) | setElementInterior ( getLocalPlayer(), interior, 2233.91, 1714.73, 1011.38 ) | ||
else | else | ||
--They | --They didn't give one, so set them to the interior they wanted, but don't teleport them. | ||
setElementInterior ( getLocalPlayer(), interior ) | setElementInterior ( getLocalPlayer(), interior ) | ||
end | end |
Revision as of 12:41, 16 August 2007
This function allows you to set the interior of any element. An interior is the current loaded place, 0 being outside.
Syntax
bool setElementInterior ( element theElement, int interior, [float x, float y, float z] )
Required Arguments
- theElement: The element in which you'd like to set the interior of.
- interior: The interior you want to set the element to.
Returns
Returns true if theElement and interior are valid arguments, false otherwise.
Optional Arguments
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
Example
Click to expand [+]
ServerClick to expand [+]
ClientSee 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