SetElementInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 4: Line 4:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setElementInterior ( element theElement, int interior )
bool setElementInterior ( element theElement, int interior, [float x, float y, float z] )
</syntaxhighlight>
</syntaxhighlight>


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===
* '''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==
==Example==

Revision as of 11:09, 19 September 2006

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

addCommandHandler ( "interior", "interior" )
function interior ( source, key, interior )
  if ( interior == "1" ) then
    setElementInterior ( source, interior, 2233.91, 1714.73, 1011.38 )
  else
    setElementInterior ( source, interior )
  end
end

See Also