GetCameraMode

From Multi Theft Auto: Wiki
Revision as of 13:57, 15 August 2007 by Arc (talk | contribs) (Fixed spelling of addCommandHandler, placed it after function declaration, second argument is a function pointer and not a string)
Jump to navigation Jump to search

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.

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
addCommandHandler( "camera", checkCamera )

See Also