Skip to content

Hotwire ​

Documentation of jo_hotwire, the free and open source FiveM hotwire script with a GTA 6 (GTA VI) style two-stick minigame: players steal parked cars by turning both sticks to the right spots to start the engine without a key. It runs on FiveM (GTA V) and is inspired by GTA VI, not an official Rockstar Games product.

1. Installation ​

Hotwire is a standalone script. So you don't need a specific framework to use it. It also means it works with all frameworks (ESX, QBCore, QBox, VRP, …). It only requires OneSync.

  • Get it for free on the store, then download it from the Cfx.re portal
  • Drag and drop the resource in your resources folder
    • jo_hotwire
  • Add it to your server.cfg
    • ensure jo_hotwire

Congratulation, the Hotwire script is ready to be used!

2. Usage ​

When a player sits in the driver seat of a parked vehicle with its engine off, the minigame starts by itself:

  1. Two half-circles appear above the vehicle. Their orientation changes at every attempt.
  2. Each stick must point at the middle of its half-circle: the half-circle fills as the stick gets closer.
  3. Both sticks must stay in their zone for a moment to start the engine.
  4. If the time runs out, the attempt fails and the alarm may go off. Press H (D-pad right on a gamepad) to try again.
InputLeft half-circleRight half-circle
GamepadLeft stickRight stick
Keyboard & mouseMovement keys (8 directions)Mouse

Cancel the attempt with F, Escape or Backspace (B on a gamepad).

By default, only the parked ambient vehicles need to be hotwired:

  • Vehicles spawned by scripts (garages, admin menus) are ignored: Config.hotwireScriptVehicles
  • Vehicles taken from a driver with the engine running are ignored: Config.hotwireRunningVehicles
  • Bicycles, boats, helicopters, planes and trains never need it: Config.excludedClasses

Once hotwired, a vehicle stays hotwired for every player.

3. Configuration ​

The configuration files are located in the config folder within the resource. This folder contains two subfolders:

  • _default.lock/ - Contains the default configuration files. Do not edit these files directly as they may be overwritten during updates.
  • custom/ - This is where you place your custom configuration files to override the defaults.

How to customize the configuration ​

  1. Navigate to jo_hotwire/config/_default.lock/
  2. Copy the file you want to modify (e.g., prices.lua )
  3. Paste it into jo_hotwire/config/custom/
  4. Edit the copied file in the custom folder

The script automatically loads files from custom/ first, and only uses _default.lock/ as a fallback. This system ensures your customizations are preserved when updating the script.

Default configuration files ​

Loading configuration...

4. Integration with your scripts ​

All the integration points are functions of config/_default.lock/functions.lua. Copy the file into config/custom to edit them.

FunctionSideUse
Config.needsHotwire(vehicle)ClientReturn false to skip the minigame (e.g. the player has the keys)
Config.canStartHotwire(vehicle)ClientReturn false to block an attempt (e.g. missing item)
Config.notify(message, type)ClientUse your own notification system
Config.onHotwireSuccess(vehicle)ClientGive the keys with your key script
Config.onHotwireFailed(vehicle, alarmTriggered)ClientSend a police alert with your dispatch script
Config.onVehicleHotwiredServer(source, vehicle)ServerThe server validated a hotwire
Config.onHotwireFailedServer(source, vehicle, alarmTriggered)ServerA player failed a hotwire

QBcore Skip the minigame with the vehicle keys ​

lua
Config.needsHotwire = function(vehicle)
  return not exports["qb-vehiclekeys"]:HasKeys(GetVehicleNumberPlateText(vehicle))
end

5. For developers ​

Exports ​

lua
-- @side : Client side
exports.jo_hotwire:StartHotwire(vehicle)        -- Run an attempt on the vehicle driven by the player, returns true on success
exports.jo_hotwire:IsVehicleHotwired(vehicle)
exports.jo_hotwire:SetVehicleHotwired(vehicle)  -- e.g. when the player gets the keys
exports.jo_hotwire:StartMinigame()              -- Use the minigame alone, returns true on success
exports.jo_hotwire:IsMinigameRunning()
lua
-- @side : Server side
exports.jo_hotwire:SetVehicleHotwired(vehicle)  -- or (netId, true)
exports.jo_hotwire:IsVehicleHotwired(vehicle)

Events ​

lua
-- @side : Client side
AddEventHandler("jo_hotwire:client:hotwireStarted", function(vehicle) end)
AddEventHandler("jo_hotwire:client:hotwireSucceeded", function(vehicle) end)
AddEventHandler("jo_hotwire:client:hotwireFailed", function(vehicle, alarmTriggered) end)
AddEventHandler("jo_hotwire:client:hotwireCancelled", function(vehicle) end)
lua
-- @side : Server side
AddEventHandler("jo_hotwire:server:vehicleHotwired", function(source, vehicle) end)
AddEventHandler("jo_hotwire:server:hotwireFailed", function(source, vehicle, alarmTriggered) end)

Debug commands ​

With Config.debugMode = true:

  • /hotwire: force an attempt on the current vehicle
  • /hotwireMinigame: run the minigame alone
  • /resetHotwire: forget the hotwired state of the current vehicle, or of the closest one within 6 m when on foot

Last updated: