setElementInterior | Multi Theft Auto: Wiki Skip to content

setElementInterior

Client-side
Server-side
Shared

Pair: getElementInterior

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to set the interior of any element. An interior is the current loaded place, 0 being outside.

Note

If passing the same interior as the element is in, the call will be ignored and position (optional arguments) will not be set either. Use setElementPosition separately to be sure the position will be set.

Note

Some objects / buildings in interior 13 show in all interiors.

Syntax

setElementInterior ( )

Code Examples

server

In this example, if a player were to type /interior 1, they would be teleported into this interior

function interior ( source, commandName, interior )
--Let's see if they gave an interior ID
if ( interior ) then
--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 )
else
--They didn't give one, so set them to the interior they wanted, but don't teleport them.
setElementInterior ( source, 0 )
end
end
addCommandHandler ( "interior", interior )

See Also

Element Functions