GetCameraMode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Black Dragon (talk | contribs) mNo edit summary |
||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<!-- Explain what the example is in a single sentance --> | |||
This function checks the camera state of a player. | |||
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | |||
<syntaxhighlight lang="lua"> | |||
addCommandHanler( "camera", "checkCamera" ) | |||
function checkCamera( source, command, player ) | |||
player = getPlayerFromName( player ) --Gets the player using his name | |||
outputConsole( getCameraMode( player ), source ) --Outputs the state of players' camera. | |||
end | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Camera functions}} | {{Camera functions}} | ||
Revision as of 12:02, 19 April 2007
This function returns a string containing the current mode of the specified player's camera.
Syntax
string getCameraMode ( player thePlayer )
Required Arguments
- thePlayer: The player whose camera mode you wish to obtain.
Returns
Returns a string with one of two values if successful:
- player: The camera is attached to a player.
- fixed: The camera is in a fixed position.
The function will return false if unsuccessful.
Example
This function checks the camera state of a player.
addCommandHanler( "camera", "checkCamera" ) function checkCamera( source, command, player ) player = getPlayerFromName( player ) --Gets the player using his name outputConsole( getCameraMode( player ), source ) --Outputs the state of players' camera. end
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget