# Forcing first-person aim in FiveM

> Force first person while aiming in FiveM: follow-cam view modes, switching on aim and back on release, drive-by view and blocking the V camera key.

Source: https://fam-tools.com/guides/fivem-first-person-aiming · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 8 min

**Short answer.** `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.

## Key points

- View modes: 0 third close, 1 third mid, 2 third far, 4 first person.
- Store the player’s view, force 4 on aim, restore on release.
- Block control **0** (`INPUT_NEXT_CAMERA`) while aiming.
- Vehicles have their own view mode functions.

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

*client.lua*

```lua
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](https://fam-tools.com/guides/fivem-weapons-meta-explained).

## Questions

### How do I force first person when aiming in FiveM?

Store `GetFollowPedCamViewMode()`, call `SetFollowPedCamViewMode(4)` while aiming, and restore the stored mode when aiming stops.

### What is view mode 4?

First person. Modes 0–2 are the three third-person distances.

### How do I stop players pressing V to switch back?

Disable control 0 (`INPUT_NEXT_CAMERA`) every frame while aiming.

### Does it work in vehicles?

Yes — use `GetFollowVehicleCamViewMode` and `SetFollowVehicleCamViewMode` when the player is in a vehicle.

## Related

- https://fam-tools.com/guides/fivem-crosshair-reticle
- https://fam-tools.com/guides/fivem-disable-combat-roll-quickswap
- https://fam-tools.com/guides/fivem-weapon-camera-shake-sway
- https://fam-tools.com/guides/fivem-recoil-script
