Disabling combat rolling and weapon quick-swapping
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.

#The controls involved
| ID | Control | Default key |
|---|---|---|
| 14 / 15 | INPUT_WEAPON_WHEEL_NEXT / PREV | Mouse wheel (while wheel open) |
| 16 / 17 | INPUT_SELECT_NEXT_WEAPON / PREV | Mouse wheel |
| 22 | INPUT_JUMP | Space |
| 24 | INPUT_ATTACK | Left mouse |
| 25 | INPUT_AIM | Right mouse |
| 37 | INPUT_SELECT_WEAPON | Tab (weapon wheel) |
| 157–165 | INPUT_SELECT_WEAPON_UNARMED … SNIPER | 1–9 |
#Disabling the combat roll
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
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.
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)Questions
How do I disable combat rolling in FiveM?
Which control IDs switch weapons?
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?
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.