[Release] Wheel Clamp Script - Immobilize Vehicles with Ease!

Hey everyone!

I’m excited to share my new Wheel Clamp Script for FiveM servers! This script allows players with specific jobs (e.g., police) to apply and remove wheel clamps on vehicles, immobilizing them to prevent movement. Perfect for roleplay scenarios where law enforcement needs to enforce parking violations or detain vehicles!

Features:

  • Apply/Remove Wheel Clamps: Use commands /wheelclamp and /removewheelclamp to apply or remove clamps (configurable to disable commands if using a tablet/menu).

  • Job Restrictions: Restrict clamp usage to specific jobs (e.g., police) using ESX or Standalone frameworks.

  • Framework Support: Compatible with ESX/QBCore and Standalone setups

  • Tablet/Menu Integration: Export functions (ApplyClamp, RemoveClamp) for easy integration with police tablets or menus.

  • Persistent Clamps: Clamps are saved to the database (oxmysql) and persist through server restarts.

  • Visual Feedback: A wheel clamp prop (prop_spot_clamp) is attached to the vehicle’s wheel (x = -0.1, y = 0.0, z = 0.4).

  • Performance: Ultra-lightweight with 0.00ms idle resmon and only 0.15ms when a player attempts to brake a clamped vehicle.
    image

  • TODO:

    • Add prop removal when a vehicle is towed (e.g., by a towing script).

Performance:

  • Idle: 0.00ms (completely idle when no clamped vehicles are being interacted with).
  • Active: 0.15ms (only when a player is in a clamped vehicle and attempts to brake, due to immobilization logic).

Requirements:

  • oxmysql for database storage.
  • ESX (optional, if not using Standalone mode).

Download & Source: Check out the script on GitHub: GitHub - PerrfQ/WheelClamp: WheelClamp by PerfQ

Installation & Usage: See the README.md on GitHub for detailed installation and usage instructions.

Feedback: I’d love to hear your feedback or suggestions! If you encounter any issues or have ideas for improvements (e.g., adding a fine system for removing clamps), feel free to comment below or open an issue on GitHub. Let’s make this script even better together!

Changelog:
20.05.2025 Item support for ESX + QBCore support

Video Preview: https://youtu.be/_sz4DkpJiQw

6 Likes

Nice to see a free release and a novel idea, will check it out

1 Like

Nice free release, but the prop isnt deleting if car isnt existant

Could use this if u want:

function FindAttachedClampByEntity()
    local clampHash = 127052170
    local objects = GetGamePool('CObject')

    for _, obj in ipairs(objects) do
        if GetEntityModel(obj) == clampHash then
            local attachedTo = GetEntityAttachedTo(obj)
            if attachedTo == 0 or not DoesEntityExist(attachedTo) then
                if Config.DebugMode then
                    print('Removing orphaned clamp: ' .. obj)
                end
                RemoveWheelClampVisual(obj)
            end
        end
    end
end

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(5000) -- every 5 seconds
        FindAttachedClampByEntity()
    end
end)
1 Like

Or you can use the esx_police f6 menu and add there object ID. Btw enumerating all obj each 5 sec can destroy optymalization.

If qbcore is in todo list it isnt fully standalone yet

Script have option to work standalone.
I can even say that script can me modified to work with qbcore. Only thing i have to do is change the esx recognition of jobs native to qbcore

Can please add feature using clamp as an item instead of command?

For esx? Or qbcore?

im using esx core ,ox inventory

Updated. Check newest version on github

1 Like

image
What is the item name to be added to ox inventory items.lua if i enable it to true?

Readme.md
Item name is “wheelclamp” but can be changed in server.lua.
Even in readme is full copypaste for oxinventory just for you

Ok ok , now i see it :sweat_smile:

After i clamped it i still can drive it… when i pay for impound from the parking garage.

Ensure u using sql.
Code from clientside: 261-284 is checking every vehicle you enter.
Server 226- 241 is checking if the veh you enter has clamp. and sending info to clientside:
Client 286-347 is checking if veh you are in have clamp
Clamps are secured in 2 ways. One is table on serverside One is sql.
If you have table only when sql updates table go nil
You need both systems. SQL and Table on serverside. it’s optymalization trick.
If u have further problems just change Config.Debugmode on true and check logs. again.
Check rest of the config maybe it’s screaming something for you.
If you need further help after all of that, message me on DM. Maybe i can help you

Cool script! Using it on standalone for now until it gets updated to work with qb-core. Item use = true doesn’t work on standalone version. Works only using the commands, but no big issue. Thanks for sharing this script!