GetCameraInterior: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Needs example)
(Added a server-side example.)
Line 26: Line 26:


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


==See Also==
==See Also==
{{Camera functions}}
{{Camera functions}}
[[Category:Needs Example]]
[[Category:Needs Example]]

Revision as of 02:46, 31 May 2010

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

Syntax

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

Required Arguments

thePlayer: the player whose camera interior you want to check.

Click to collapse [-]
Client
int getCameraInterior ( )

Required Arguments

None

Returns

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

Example

This example outputs the interior the player's camera is in.

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

See Also