I’ve been trying to look around here, and google. I haven’t been able to find anything. Is it possible to have just TWO camera options 3rd and First Person, instead of cycling through all of them?
Thanks!
Edit: thank you guys for the help, I will try these.
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if GetFollowPedCamViewMode() == 0 or GetFollowPedCamViewMode() == 1 then
SetFollowPedCamViewMode(2)
end
end
end)
--view mode enumeration
--[[{
THIRD_PERSON_NEAR = 0,
THIRD_PERSON_MEDIUM = 1,
THIRD_PERSON_FAR = 2,
CINEMATIC = 3,
FIRST_PERSON = 4,
}]]
The above code checks if the player ped’s camera is in 3rd person near or 3rd person medium (the first 2 cameras in the cycle). If yes, it switches to the 3rd person far camera.
Keep in mind that this might be slow, and that I haven’t tested it.
Here’s what I use. It also forces the view mode while in a vehicle and on foot.
Citizen.CreateThread(function()
while true do
local ped = PlayerPedId()
local player = PlayerId()
local isInVehicle = IsPedInAnyVehicle(ped, false)
if isInVehicle then
local viewMode = GetFollowVehicleCamViewMode()
if viewMode == 1 or viewMode == 2 then
SetFollowVehicleCamViewMode(4)
end
else
local viewMode = GetFollowPedCamViewMode()
if viewMode == 1 or viewMode == 2 then
SetFollowPedCamViewMode(4)
end
end
Citizen.Wait(0)
end
end)
Just a quick thing about this. You only check if the viewMode is > than 0 and that also includes the first person cam, which means that you will set the FPS camera every single frame if the player is already in FPS.