GetElementInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 15: Line 15:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler ( "AmIOutside", "AmIOutside" )
function AmIOutside ( source, key )
  if ( getElementInterior ( source ) == 0 ) then
    outputChatBox ( "Yes you are outside " .. getClientName ( source ) )
  else
    outputChatBox ( "No you aren't outside " .. getClientName ( source ) )
  end
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Element functions}}
{{Element functions}}

Revision as of 11:05, 19 September 2006

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

addCommandHandler ( "AmIOutside", "AmIOutside" )
function AmIOutside ( source, key )
  if ( getElementInterior ( source ) == 0 ) then
    outputChatBox ( "Yes you are outside " .. getClientName ( source ) )
  else
    outputChatBox ( "No you aren't outside " .. getClientName ( source ) )
  end
end

See Also