GetCameraMode: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{deprecated}}
{{DeprecatedWithAlt|getCameraTarget|}}
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
Please use [[getCameraTarget]]


This function returns a [[string]] containing the current mode of the player's camera.
This function returns a [[string]] containing the current mode of the player's camera.

Revision as of 22:58, 21 October 2011

Template:DeprecatedWithAlt


This function returns a string containing the current mode of the 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, by specifying his name:

function checkCamera( source, command, targetName )
      local targetPlayer = getPlayerFromNick ( targetName )   -- Get the player using his name
      outputConsole( targetName.."'s camera mode is: "..getCameraMode( targetPlayer ), source )  -- Output the state of player's camera
end
addCommandHandler( "camera", checkCamera )

See Also