GetCameraTarget: Difference between revisions
Jump to navigation
Jump to search
Black Dragon (talk | contribs) No edit summary |
Black Dragon (talk | contribs) mNo edit summary |
||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
This example | This example checks wether a players cameras target is another player, and returns true or false accordingly. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function isTargetPlayer( player ) | ||
local target = getCameraTarget( player ) | local target = getCameraTarget( player ) | ||
if ( target ) then --If target is | if ( getElementType ( target ) == "player" ) then --If target is a player | ||
return | return true --Return true | ||
else | else | ||
return false --Otherwise, return false. | return false --Otherwise, return false. |
Revision as of 08:05, 14 June 2007
This function returns an element that corresponds to the current target of the specified player's camera (i.e. what it is following).
Syntax
element getCameraTarget ( player thePlayer )
Required Arguments
- thePlayer: The player whose camera you wish to receive the target of.
Returns
Returns an element if the function was successful, false otherwise.
Example
This example checks wether a players cameras target is another player, and returns true or false accordingly.
function isTargetPlayer( player ) local target = getCameraTarget( player ) 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