GetElementInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (andere Sprache hinzugefügt)
m (→‎Syntax: OOP)
Line 7: Line 7:
int getElementInterior ( element theElement )
int getElementInterior ( element theElement )
</syntaxhighlight>
</syntaxhighlight>
{{OOP|This function is also a static function underneath the Element class.|[[element]]:getInterior|interior|}}


===Required Arguments===
===Required Arguments===

Revision as of 16:19, 16 August 2014

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 )

OOP Syntax Help! I don't understand this!

Note: This function is also a static function underneath the Element class.
Method: element:getInterior(...)
Variable: .interior


Required Arguments

  • theElement: The element of which you'd like to retrieve the interior

Returns

Returns an int for the interior if theElement is valid, false otherwise.

Example

Click to collapse [-]
Server

This example shows a player if he is outside or not, when he enters the command 'AmIOutside'.

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

See Also