SetElementInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (flaw in example)
Line 26: Line 26:
function interior ( source, commandName, interior )
function interior ( source, commandName, interior )
   --Let's see if they gave an interior ID
   --Let's see if they gave an interior ID
   if ( interior == "1" ) then
   if ( interior ) 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 )
Line 43: Line 43:
function interior ( commandName, interior )
function interior ( commandName, interior )
   --Let's see if they gave a interior ID
   --Let's see if they gave a interior ID
   if ( interior == "1" ) then
   if ( interior ) then
     --They did, so let's assign them to that interior and teleport them there (all in 1 function call!)
     --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 )

Revision as of 02:43, 7 February 2008

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. Valid values are 0 to 255.

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 [+]
Server
Click to expand [+]
Client

See Also