Combatbeginner8 min readupdated 11 Sept 2026

Disabling combat rolling and weapon quick-swapping

The short answer

The combat roll is the jump control (22) pressed while aiming (25). Disable 22 while the player is aiming or free-aiming. Quick swap uses the weapon slot keys 1–9 (controls 157–165) and the scroll wheel (14–17); disable those, or call SetPedCanSwitchWeapon(ped, false) while shooting. Run the loop every frame only while armed so idle cost stays at 0.00 ms.

Combat rolling while aiming and instantly swapping weapons with the number keys are fine in GTA Online but break roleplay gunfights and competitive PvP balance. Both are just game controls, so a short client loop can switch them off — or limit them — without touching anything else.

Disabling combat rolling and weapon quick-swapping — illustrated with a FiveM-compatible minimap render

#The controls involved

IDControlDefault key
14 / 15INPUT_WEAPON_WHEEL_NEXT / PREVMouse wheel (while wheel open)
16 / 17INPUT_SELECT_NEXT_WEAPON / PREVMouse wheel
22INPUT_JUMPSpace
24INPUT_ATTACKLeft mouse
25INPUT_AIMRight mouse
37INPUT_SELECT_WEAPONTab (weapon wheel)
157–165INPUT_SELECT_WEAPON_UNARMED … SNIPER1–9

#Disabling the combat roll

client.lua
CreateThread(function()
    while true do
        local sleep = 500
        local ped = PlayerPedId()
        if IsPedArmed(ped, 4) then
            sleep = 0
            if IsControlPressed(0, 25) or IsPlayerFreeAiming(PlayerId()) then
                DisableControlAction(0, 22, true)
            end
        end
        Wait(sleep)
    end
end)

IsPedArmed(ped, 4) checks for firearms only (1 = melee, 2 = explosives), so the loop sleeps while the player carries nothing that can roll.

#Disabling quick swap

client.lua — block slot keys and scroll switching
local SWAP = { 14, 15, 16, 17, 157, 158, 159, 160, 161, 162, 163, 164, 165 }

CreateThread(function()
    while true do
        local sleep = 500
        if IsPedArmed(PlayerPedId(), 4) then
            sleep = 0
            for i = 1, #SWAP do
                DisableControlAction(0, SWAP[i], true)
            end
        end
        Wait(sleep)
    end
end)

If your inventory equips weapons from hotbar slots (ox_inventory, qb-inventory), the number keys are usually already taken by the inventory and the game’s own slot keys are disabled — check before adding this. To remove the Tab weapon wheel entirely, see disabling the weapon wheel.

#A roll cooldown instead of a ban

A softer rule: allow one roll every few seconds. Detect the jump press while aiming, then disable it for a cooldown.

client.lua — one roll every 3 seconds
local nextRoll = 0

CreateThread(function()
    while true do
        local sleep = 500
        if IsPedArmed(PlayerPedId(), 4) then
            sleep = 0
            if IsControlPressed(0, 25) then
                if GetGameTimer() < nextRoll then
                    DisableControlAction(0, 22, true)
                elseif IsControlJustPressed(0, 22) then
                    nextRoll = GetGameTimer() + 3000
                end
            end
        end
        Wait(sleep)
    end
end)
Share this guideXRedditFacebook

Questions

How do I disable combat rolling in FiveM?
Disable control 22 (jump) every frame while the player aims (control 25) or is free-aiming.
Which control IDs switch weapons?
157–165 for the number keys, 14–17 for wheel and scroll switching and 37 for the Tab weapon wheel.
Why does my disable script not work?
DisableControlAction lasts one frame. It must run in a loop with Wait(0) while it should be active.
Will this cost performance?
Barely, if the loop sleeps while the player is unarmed. Check it in resmon.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.

Relevant to what you just read

The tool for this

Fifty-one wheel designs that replace the native HUD wheel From $15, built in the browser, exported as a drop-in resource.

Look it up while you work

The reference tables this guide leans on, free and without an account.

  • All 860 ped model namesEvery model GetHashKey resolves, with its hash and how many clothing components and props it carries.