DirkScripts Logo

Login With FiveM

Login

πŸ“š Library
β€Ί
Modules
β€Ί

disableControls

disableControls

ℹ️ Client Module - This can only be used on the client

Usage

lib.disableControls manages a set of GTA control IDs to disable. It uses reference counting β€” controls are only disabled while at least one consumer has added them.

lua
-- Add controls to the disable set
lib.disableControls:Add(1, 2, 3) -- movement controls

-- Call every frame to apply (e.g. inside a loop or tick)
lib.disableControls()

-- Remove specific controls when no longer needed
lib.disableControls:Remove(1, 2)

-- Clear all disabled controls
lib.disableControls:Clear()

Methods

:Add(...)

Add control IDs to the disable set.

lua
lib.disableControls:Add(24, 25, 47, 58) -- combat controls

:Remove(...)

Remove specific control IDs from the disable set.

lua
lib.disableControls:Remove(24, 25)

:Clear(...)

Clear specific or all control IDs. Call with no arguments to clear everything.

lua
lib.disableControls:Clear()     -- clear all
lib.disableControls:Clear(47)   -- clear specific

Applying

Call lib.disableControls() (as a function) every frame to actually disable the controls:

lua
CreateThread(function()
    lib.disableControls:Add(1, 2, 3)
    while someCondition do
        lib.disableControls()
        Wait(0)
    end
    lib.disableControls:Clear()
end)

ℹ️ Control IDs reference: FiveM Controls β†—

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.