Forcing first-person aim in FiveM
GetFollowPedCamViewMode() returns the current on-foot view (4 = first person). When the player starts aiming, store it and call SetFollowPedCamViewMode(4); when they stop, restore the stored mode. For vehicles use GetFollowVehicleCamViewMode() / SetFollowVehicleCamViewMode(4). Disable control 0 (V) while aiming so players cannot switch back.
Third-person aiming lets players peek around corners without exposing themselves. Many roleplay and PvP servers therefore force first person while a weapon is raised — and restore the player’s own view when they lower it. It takes one small client script.

#View modes
| Mode | View |
|---|---|
| 0 | Third person, near |
| 1 | Third person, medium |
| 2 | Third person, far |
| 4 | First person |
#The script
local FIRST = 4
local saved
CreateThread(function()
while true do
local sleep = 250
local ped = PlayerPedId()
if IsPedArmed(ped, 4) then
sleep = 0
local aiming = IsControlPressed(0, 25) or IsPlayerFreeAiming(PlayerId())
local inVeh = IsPedInAnyVehicle(ped, false)
if aiming then
DisableControlAction(0, 0, true)
if inVeh then
if GetFollowVehicleCamViewMode() ~= FIRST then
saved = saved or GetFollowVehicleCamViewMode()
SetFollowVehicleCamViewMode(FIRST)
end
elseif GetFollowPedCamViewMode() ~= FIRST then
saved = saved or GetFollowPedCamViewMode()
SetFollowPedCamViewMode(FIRST)
end
elseif saved then
if inVeh then SetFollowVehicleCamViewMode(saved) else SetFollowPedCamViewMode(saved) end
saved = nil
end
elseif saved then
SetFollowPedCamViewMode(saved)
saved = nil
end
Wait(sleep)
end
end)The loop sleeps while unarmed and runs every frame only while a firearm is out, which is when control 0 must be disabled each frame.
#Vehicles and drive-bys
Drive-by aiming from a vehicle uses the vehicle camera, so the script switches the vehicle view mode instead. Some servers prefer to block drive-bys for drivers entirely; SetPlayerCanDoDriveBy(PlayerId(), false) does that.
#When a weapon looks wrong in first person
Add-on weapons sometimes sit oddly in first person — too close, clipping, or with a misaligned scope. Those offsets live in the weapon’s weapons.meta (the FirstPerson…Offset fields) and in the model itself. See weapons.meta explained.
Questions
How do I force first person when aiming in FiveM?
GetFollowPedCamViewMode(), call SetFollowPedCamViewMode(4) while aiming, and restore the stored mode when aiming stops.What is view mode 4?
How do I stop players pressing V to switch back?
INPUT_NEXT_CAMERA) every frame while aiming.Does it work in vehicles?
GetFollowVehicleCamViewMode and SetFollowVehicleCamViewMode when the player is in a vehicle.Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read
Look it up while you work
The reference tables this guide leans on, free and without an account.
- All 921 vehicle spawn namesEvery vanilla model with a picture, its display name, its class and the hash CreateVehicle takes.