SetCameraMode: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (First argument of setTimer is now a function pointer, not a string)
Line 24: Line 24:
function spawnScreen ( source ) --Calls the function spawnScreen
function spawnScreen ( source ) --Calls the function spawnScreen
setCameraMode ( source, "fixed" ) --Classifies which camera mode to use for the spawn screen
setCameraMode ( source, "fixed" ) --Classifies which camera mode to use for the spawn screen
setTimer ( "setCameraPosition", 1000, 1, source, 160.15, -1951.68, 50 ) --Coords for the fixated camera
setTimer ( setCameraPosition, 1000, 1, source, 160.15, -1951.68, 50 ) --Coords for the fixated camera
setTimer ( "setCameraLookAt", 1000, 1, source, 165, -1951.68, 50 ) --Coords for the fixated camera
setTimer ( setCameraLookAt, 1000, 1, source, 165, -1951.68, 50 ) --Coords for the fixated camera
bindKey ( source, "F1", "down", "spawnVagos" ) --Spawns player as team #1. In this case, a new function is created later on
bindKey ( source, "F1", "down", "spawnVagos" ) --Spawns player as team #1. In this case, a new function is created later on
bindKey ( source, "F2", "down", "spawnAztecs" ) --Spawns player as team #2. In this case, a new function is created later on
bindKey ( source, "F2", "down", "spawnAztecs" ) --Spawns player as team #2. In this case, a new function is created later on

Revision as of 13:54, 15 August 2007

Please remember to set players camera mode back to "player" on resource unload, or you will encounter the invisible player 'bug' if players camera is still set to fixed

This function allows you to change a player's camera mode to either "player" or "fixed".

Syntax

bool setCameraMode ( player thePlayer, string mode )

Required Arguments

  • thePlayer: The player whose camera you wish to modify.
  • mode: The mode to be set. It has the following possible values:
    • "player": Sets the camera to follow a player.
    • "fixed": Fixes the camera in a set position/rotation.

Returns

Returns a bool with a value of true if the function was successful, false otherwise.

Example


function spawnScreen ( source ) --Calls the function spawnScreen
setCameraMode ( source, "fixed" ) --Classifies which camera mode to use for the spawn screen
	setTimer ( setCameraPosition, 1000, 1, source, 160.15, -1951.68, 50 ) --Coords for the fixated camera
	setTimer ( setCameraLookAt, 1000, 1, source, 165, -1951.68, 50 ) --Coords for the fixated camera
	bindKey ( source, "F1", "down", "spawnVagos" ) --Spawns player as team #1. In this case, a new function is created later on
	bindKey ( source, "F2", "down", "spawnAztecs" ) --Spawns player as team #2. In this case, a new function is created later on
end

See Also