Skip to main content

SetPlayerCameraPos

คำอธิบาย

Sets the camera to a specific position for a player.

NameDescription
playeridID of the player
Float:xThe X coordinate to place the camera at.
Float:yThe Y coordinate to place the camera at.
Float:zThe Z coordinate to place the camera at.

ส่งคืน

1: The function executed successfully.

0: The function failed to execute. The player specified doesn't exist.

ตัวอย่าง

SetPlayerCameraPos(playerid, 652.23, 457.21, 10.84);

บันทึก

tip

You may also have to use SetPlayerCameraLookAt with this function in order to work properly. Use SetCameraBehindPlayer to reset the camera to behind the player.

warning

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

ฟังก์ชั่นที่เกี่ยวข้องกัน

  • SetPlayerCameraLookAt: Set where a player's camera should face.
  • SetCameraBehindPlayer: Set a player's camera behind them.