M MY Multiplayer: Wiki
Side
Kind

setCameraTarget

Client

Makes the camera follow a player or ped, as in normal play. It also undoes setCameraMatrix and attachCameraToElement.

bool setCameraTarget(player|ped target)

Parameters

NameTypeDescription
targetplayer|pedThe player or ped. localPlayer gives the camera back to the local player.

Returns

true if the camera now follows the target. false if it is neither a player nor a ped, or is not loaded.

Example

addCommandHandler("resetcam", function()
    setCameraTarget(localPlayer)
end)

See also