Skip to content

Latest commit

 

History

History
255 lines (200 loc) · 5.21 KB

EXPORTS.md

File metadata and controls

255 lines (200 loc) · 5.21 KB

Exports

Exported freecam functions.

Examples assume you are referencing the freecam exports as such:

local Freecam = exports['fivem-freecam']
Freecam:SetActive(true)

Getters

Setters


IsActive

Returns wether the freecam is currently active or not.

bool isActive = Freecam:IsActive()

SetActive

Enters or exits the freecam.

void Freecam:SetActive(bool active)

IsFrozen

Returns wether the freecam position is currently frozen.

bool isFrozen = Freecam:IsFrozen()

SetFrozen

Sets the freecam frozen. When frozen, controls do not update the position or rotation anymore but SetPosition/SetRotation will.

void Freecam:SetFrozen(bool frozen)

GetFov

Returns the field of view of the freecam.

float fov = Freecam:GetFov()

SetFov

Sets the current field of view of the freecam. This does NOT update the default FOV for the freecam. Use SetCameraSetting for that.

void Freecam:SetFov(float fov)

GetPosition

Returns the current position of the freecam.

vector3 position = Freecam:GetPosition()

SetPosition

Sets a new position for the freecam.

void Freecam:SetPosition(float posX, float posY, float posZ)

GetRotation

Returns the current rotation of the freecam.

vector3 rotation = Freecam:GetRotation()

SetRotation

Sets a new position for the freecam.

void Freecam:SetRotation(float rotX, float rotY, float rotZ)

GetMatrix

Returns the current view matrix of the freecam.

vector3 vecX, vector3 vecY, vector3 vecZ, vector3 pos = Freecam:GetMatrix()

GetTarget

Returns the position the freecam is looking at from the given distance.

vector3 target = Freecam:GetTarget(float distance)

GetPitch

Returns the current pitch (rotX) of the freecam.

float pitch = Freecam:GetPitch()

GetRoll

Returns the current roll (rotY) of the freecam.

float roll = Freecam:GetRoll()

GetYaw

Returns the current yaw (rotZ) of the freecam.

float yaw = Freecam:GetYaw()

GetCameraSetting

Returns the value of a camera setting. See CONFIGURING for details.

mixed value = Freecam:GetCameraSetting(string key)

SetCameraSetting

Sets the value of a camera setting. See CONFIGURING for details.

void Freecam:SetCameraSetting(string key, mixed value)

GetKeyboardSetting

Returns the value of a keyboard setting. See CONFIGURING for details.

mixed value = Freecam:GetKeyboardSetting(string key)

SetKeyboardSetting

Sets the value of a keyboard setting. See CONFIGURING for details.

void Freecam:SetKeyboardSetting(string key, mixed value)

GetGamepadSetting

Returns the value of a gamepad setting. See CONFIGURING for details.

mixed value = Freecam:GetGamepadSetting(string key)

SetGamepadSetting

Sets the value of a gamepad setting. See CONFIGURING for details.

void Freecam:SetGamepadSetting(string key, mixed value)

GetKeyboardControl

Returns the value of a keyboard control. See CONFIGURING for details.

mixed value = Freecam:GetKeyboardControl(string key)

SetKeyboardControl

Sets the value of a keyboard control. See CONFIGURING for details.

void Freecam:SetKeyboardControl(string key, int value)
void Freecam:SetKeyboardControl(string key, table value)

GetGamepadControl

Returns the value of a gamepad control. See CONFIGURING for details.

mixed value = Freecam:GetGamepadControl(string key)

SetGamepadControl

Sets the value of a gamepad control. See CONFIGURING for details.

void Freecam:SetGamepadControl(string key, int value)
void Freecam:SetGamepadControl(string key, table value)