SetCameraPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Flagged as deprecated.)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{Deprecated}}
This function allows you to move a player's camera to a specific location if it is fixed (see [[setCameraMode]]).
This function allows you to move a player's camera to a specific location if it is fixed (see [[setCameraMode]]).
   
   

Revision as of 13:57, 20 January 2009

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.

This function allows you to move a player's camera to a specific location if it is fixed (see setCameraMode).

Syntax

bool setCameraPosition ( player thePlayer, float x, float y, float z )

Required Arguments

  • thePlayer: The player whose camera you wish to modify. (not needed for clientside scripting)
  • x: The x coordinate of the new position.
  • y: The x coordinate of the new position.
  • z: The x coordinate of the new position.

Returns

Returns true if the function was successful, false otherwise.

Example

function spawnScreen ( source )
        setCameraMode ( source, "fixed" )                                     -- Make the camera fixed (instead of following the player)
        setTimer ( setCameraPosition, 1000, 1, source, 160.15, -1951.68, 50 ) -- Set the coordinates of the camera
        setTimer ( setCameraLookAt, 1000, 1, source, 165, -1951.68, 50 )      -- Make the camera look at specified coordinates
        bindKey ( source, "F1", "down", "Spawn as Vagos", spawnVagos )        -- Bind spawn key (function spawnVagos is not given here)
        bindKey ( source, "F2", "down", "Spawn as Aztecs", spawnAztecs )      -- Bind spawn key (function spawnAztecs is not given here)
end

See Also