setCameraViewMode | Multi Theft Auto: Wiki Skip to content

setCameraViewMode

Client-side
Server-side
Shared

Pair: getCameraViewMode

This function allows you to set the camera view modes. This indicates at what distance the camera will follow the player or vehicle.

OOP Syntax Help! I don't understand this!

  • Method:Camera.setViewMode(...)
  • Variable: .viewMode

Syntax

bool setCameraViewMode ( [ int vehicleCameraMode = nil, int pedCameraMode = nil ] )
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • vehicleCameraMode (default: nil): The view mode you wish to use when inside vehicles.
    • 0: Bumper
    • 1: Close external
    • 2: Middle external
    • 3: Far external
    • 4: Low external
    • 5: Cinematic
  • pedCameraMode (default: nil): The view mode you wish to use when you are not inside vehicles.
    • 0: Close
    • 1: Middle
    • 2: Far

Returns

  • bool: result

Always returns true.

Code Examples

client

This example sets the camera to bumper view when the local player enters any vehicle.

addEventHandler("onClientPlayerVehicleEnter", localPlayer, function()
setCameraViewMode(0)
end)