From SA-MP Wiki

Jump to: navigation, search


Set the direction a player's camera looks at. Generally meant to be used in combination with SetPlayerCameraPos.

(playerid,Float:x,Float:y,Float:z,cut = CAMERA_CUT)
playeridThe ID of the player whose camera to set.
Float:xThe X coordinate for the player's camera to look at.
Float:yThe Y coordinate for the player's camera to look at.
Float:zThe Z coordinate for the player's camera to look at.
cutThe style of the change. Can be used to interpolate (change slowly) from old pos to new pos using CAMERA_MOVE. NOTE: Added in 0.3e. Leave out for older versions.

Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The player specified does not exist.



Using the camera functions directly after enabling spectator mode doesn't work.

Example Usage:

SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
In other languages