Skip to content

Wheel clamp

Documentation relating to the jo_wheellock.

1. Installation

jo_wheellock is a standalone script. So you don't need a specific framework to use it. It's also mean it works with all framework (Esx, QBCore, VRP, DRP, …).

  • Drag and drop the resource in your resources folder
    • jo_wheellock
  • Add this ensure in your server.cfg
    • ensure jo_wheellock
  • Congratulation, the Wheel lock script is ready to be use !

2. Usage

You have twos way to put/remove the wheel lock on the car in front of you :

  • Use the command : /wheellock
  • Use the client event : 'jo_wheellock:action'

3. Config.lua

The configuration file is config.lua in the resource root. Do not edit this file directly as your changes may be lost during updates. Instead, use overwriteConfig.lua to store your customizations.

  • config.lua - Default configuration maintained by developers. Do not modify this file.
  • overwriteConfig.lua - This is where you place only the values you want to override.

How to customize the configuration

  1. Open /overwriteConfig.lua
  2. Find the value you want to change in config.lua (e.g., Config.language )
  3. Copy only that line into overwriteConfig.lua
  4. Edit the copied value to your liking

The script loads config.lua first, then overwriteConfig.lua overwrites only the values you redefine. This ensures your customizations are preserved when updating the script.

Loading configuration...

4. For developer

Spawn the wheel lock on car without player animation :

lua
-- @param vehNet : Server ID of the vehicle
-- @param boneName : Name of the bone where the wheel lock is
-- @side : Client side
TriggerEvent("jo_wheellock:addLockedCars", vehNet, 0, boneName)

Use event to put/remove the wheel lock :

lua
-- @side : Client side
TriggerEvent('jo_wheellock:action')       -- Put or remove the wheel lock
TriggerEvent('jo_wheellock:actionPut')    -- Only Put the wheel lock
TriggerEvent('jo_wheellock:actionRemove') -- Only Remove the wheel lock

5. Snippets

ESX Restrict the wheellock with job

Use this canUseWheellock function in the configuration

lua
ESX = exports['es_extended']:getSharedObject()
Config.canUseWheellock = function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    return (xPlayer.getJob().name == "police")
end

QBcore Restrict the wheellock with job

Use this canUseWheellock function in the configuration

lua
QBCore = exports['qb-core']:GetCoreObject()
Config.canUseWheellock = function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    return (Player.PlayerData.job.type == "police" or Player.PlayerData.job.type == "mechanic")
end

Last updated: