setCameraInterior | Multi Theft Auto: Wiki Skip to content

setCameraInterior

Client-side
Server-side
Shared

Pair: getCameraInterior

Sets the interior of the local camera. Only the interior of the camera is changed, the local player stays in the interior he was in.

OOP Syntax Help! I don't understand this!

Server OOP syntax
  • Method:player:setCameraInterior(...)
  • Variable: .cameraInterior
Client OOP syntax
  • Method:Camera.setInterior(...)
  • Variable: .interior

Client Syntax

bool setCameraInterior ( int interior )
Required Arguments
  • interior: The interior to place the camera in.

Returns

  • bool: result

Returns true if the camera's interior was changed successfully, false otherwise.

Server Syntax

bool setCameraInterior ( player thePlayer, int interior )
Required Arguments
  • thePlayer: The player whose camera interior will be set.
  • interior: The interior to place the camera in.

Returns

  • bool: result

Returns true if the camera's interior was changed successfully, false otherwise.

Code Examples

client

This example make a command to change your cam interior to a selected one.

function setCam(command, int)
if (int) then
local setInt = setCameraInterior(int)
if (setInt) then
outputChatBox("Your camera's interior has been set to " .. int, 255, 255, 0)
else
outputChatBox("Can't change your camera's interior...", 255, 0, 0)
end
else
outputChatBox("Syntax: /camera [interiorID] ", 255, 0, 0)
end
end
addCommandHandler("camera", setCam)