GetCameraInterior: Difference between revisions
Jump to navigation
Jump to search
m (Removed page from "Needs example" category.) |
m (Format fix) |
||
(9 intermediate revisions by 7 users not shown) | |||
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"> | ||
int getCameraInterior ( player thePlayer ) | int getCameraInterior ( player thePlayer ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[player]]:getCameraInterior|cameraInterior|setCameraInterior}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
'''thePlayer''': | *'''thePlayer''': The player whose camera interior you want to get. | ||
</section> | </section> | ||
Line 17: | Line 19: | ||
int getCameraInterior ( ) | int getCameraInterior ( ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||Camera.getInterior|interior|setCameraInterior}} | |||
</section> | </section> | ||
Line 25: | Line 25: | ||
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=== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function outputCameraInterior ( player, command ) | ||
local interior = getCameraInterior( | local interior = getCameraInterior ( player ) | ||
outputChatBox("The camera is in interior "..interior, | outputChatBox ( "The camera is in the interior " .. interior, player, 255, 255, 0 ) | ||
end | |||
addCommandHandler ( "camera", outputCameraInterior ) | |||
</syntaxhighlight> | |||
</section> | |||
{{New items|3.0140|1.4| | |||
==Object-oriented== | |||
===Syntax=== | |||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
int player:getCameraInterior ( ) | |||
-- or | |||
int player.cameraInterior -- to get the camera interior value | |||
player.cameraInterior = int someValue -- to set the camera interior value | |||
</syntaxhighlight> | |||
</section> | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
int Camera.getInterior ( ) | |||
</syntaxhighlight> | |||
</section> | |||
Returns an ''integer'' indicating the camera's interior, ''false'' if the argument is invalid. | |||
===Example=== | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
function outputCameraInterior ( command ) | |||
local interior = Camera.getInterior ( ) | |||
outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 ) | |||
end | end | ||
addCommandHandler("camera", | addCommandHandler ( "camera", outputCameraInterior ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
}} | |||
==See Also== | ==See Also== | ||
{{Camera functions}} | {{Camera functions}} | ||
[[hu:getCameraInterior]] | |||
[[RO:getCameraInterior]] |
Latest revision as of 17:54, 12 February 2021
Returns the interior of the local camera (independent of the interior of the local player).
Procedural
Syntax
Click to collapse [-]
Serverint getCameraInterior ( player thePlayer )
OOP Syntax Help! I don't understand this!
- Method: player:getCameraInterior(...)
- Variable: .cameraInterior
- Counterpart: setCameraInterior
Required Arguments
- thePlayer: The player whose camera interior you want to get.
Click to collapse [-]
Clientint getCameraInterior ( )
OOP Syntax Help! I don't understand this!
- Method: Camera.getInterior(...)
- Variable: .interior
- Counterpart: setCameraInterior
Returns
Returns an integer indicating the camera's interior, false if the argument is invalid.
Example
Click to collapse [-]
Serverfunction 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 [-]
Serverint player:getCameraInterior ( ) -- or int player.cameraInterior -- to get the camera interior value player.cameraInterior = int someValue -- to set the camera interior value
Click to collapse [-]
Clientint Camera.getInterior ( )
Returns an integer indicating the camera's interior, false if the argument is invalid.
Example
Click to collapse [-]
Clientfunction outputCameraInterior ( command ) local interior = Camera.getInterior ( ) outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 ) end addCommandHandler ( "camera", outputCameraInterior )