GetCameraTarget: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→Example) |
||
Line 21: | Line 21: | ||
==Example== | ==Example== | ||
This example checks whether a player's camera's target is another player, and returns true or false accordingly. | This example checks whether a player's camera's target is another player, and returns true or false accordingly. | ||
<section class="server" name="Server script" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function isTargetPlayer( thePlayer ) | function isTargetPlayer( thePlayer ) | ||
Line 34: | Line 34: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
==See Also== | ==See Also== | ||
{{Camera functions}} | {{Camera functions}} |
Revision as of 06:08, 16 March 2008
This function returns an element that corresponds to the current target of the specified player's camera (i.e. what it is following).
Syntax
Click to collapse [-]
Serverelement getCameraTarget ( player thePlayer )
Required Arguments
- thePlayer: The player whose camera you wish to receive the target of.
Click to collapse [-]
Clientelement getCameraTarget ()
Returns
Returns an element if the function was successful, false otherwise.
Example
This example checks whether a player's camera's target is another player, and returns true or false accordingly.
Click to collapse [-]
Server scriptfunction isTargetPlayer( thePlayer ) local target = getCameraTarget ( thePlayer ) if ( getElementType ( target ) == "player" ) then -- If target is a player return true -- Return true else return false -- Otherwise, return false. end end
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget