SetCameraLookAt: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(First argument of setTimer is now a function pointer, not a string)
mNo edit summary
Line 19: Line 19:


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. This will "point" the camera, so to speak.
setTimer ( setCameraLookAt, 1000, 1, source, 165, -1951.68, 50 ) --Coords for the fixated camera. This will "point" the camera, so to speak.
bindKey ( source, "F1", "down", "spawnVagos" ) --Spawns player as team #1. In this case, a new function is created later on
bindKey ( source, "F1", "down", "Spawn as Vagos", 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", "Spawn as Aztecs", spawnAztecs ) --Spawns player as team #2. In this case, a new function is created later on
end
end
</syntaxhighlight>
</syntaxhighlight>

Revision as of 14:04, 15 August 2007

This function allows you to set a specified player's camera to look at a specific point when the camera is fixed (see setCameraMode).

Syntax

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

Required Arguments

  • thePlayer: The player whose camera you wish to modify.
  • x: The x co-ordinate of the point to be looked at.
  • y: The y co-ordinate of the point to be looked at.
  • z: The z co-ordinate of the point to be looked at.

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. This will "point" the camera, so to speak.
	bindKey ( source, "F1", "down", "Spawn as Vagos", spawnVagos ) --Spawns player as team #1. In this case, a new function is created later on
	bindKey ( source, "F2", "down", "Spawn as Aztecs", spawnAztecs ) --Spawns player as team #2. In this case, a new function is created later on
end

See Also