GetCameraInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Removed page from "Needs example" category.)
No edit summary
Line 3: Line 3:
Returns the interior of the local camera (independent of the interior of the local player).
Returns the interior of the local camera (independent of the interior of the local player).


==Syntax==
==Procedural==
===Syntax===
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 10: Line 11:


===Required Arguments===
===Required Arguments===
'''thePlayer''': the player whose camera interior you want to check.
'''thePlayer''': The player whose camera interior you want to get.
</section>
</section>


Line 17: Line 18:
int getCameraInterior ( )
int getCameraInterior ( )
</syntaxhighlight>
</syntaxhighlight>
</section>
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid.
===Example===
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
function outputCameraInterior ( player, command )
local interior = getCameraInterior ( player )
outputChatBox ( "The camera is in the interior " .. interior, player, 255, 255, 0 )
end
addCommandHandler ( "camera", outputCameraInterior )
</syntaxhighlight>
</section>


===Required Arguments===
==Object-oriented==
''None''
===Syntax===
<section name="Server" class="server" show="true">
The server-side OOP is not implemented yet.
</section>
 
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
int Camera.getInterior ( )
</syntaxhighlight>
</section>
</section>


===Returns===
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid.
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid.


==Example==
===Example===
This example outputs the interior the player's camera is in.
<section name="Client" class="client" show="true">
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function camInt(thePlayer,command)
function outputCameraInterior ( command )
local interior = getCameraInterior(thePlayer)
local interior = Camera.getInterior ( )
outputChatBox("The camera is in interior "..interior,thePlayer,255,255,0)
outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 )
end
end
addCommandHandler("camera",camInt)
addCommandHandler ( "camera", outputCameraInterior )
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 19:09, 25 December 2013

Returns the interior of the local camera (independent of the interior of the local player).

Procedural

Syntax

Click to collapse [-]
Server
int getCameraInterior ( player thePlayer )

Required Arguments

thePlayer: The player whose camera interior you want to get.

Click to collapse [-]
Client
int getCameraInterior ( )

Returns an integer indicating the camera's interior, false if the argument is invalid.

Example

Click to collapse [-]
Server
function outputCameraInterior ( player, command )
	local interior = getCameraInterior ( player )
	outputChatBox ( "The camera is in the interior " .. interior, player, 255, 255, 0 )
end
addCommandHandler ( "camera", outputCameraInterior )

Object-oriented

Syntax

Click to collapse [-]
Server

The server-side OOP is not implemented yet.

Click to collapse [-]
Client
int Camera.getInterior ( )

Returns an integer indicating the camera's interior, false if the argument is invalid.

Example

Click to collapse [-]
Client
function outputCameraInterior ( command )
	local interior = Camera.getInterior ( )
	outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 )
end
addCommandHandler ( "camera", outputCameraInterior )

See Also