Documentation

Lockpicking

All information you would need regarding lockpicking vehicles.

Lockpicking unlocks a locked vehicle's doors without a key. It doesn't start the engine or give a key, so a thief usually follows it up with hotwiring.

Vehicle Keys supports two lockpicking styles:

  • zyke_lockpick minigame: a pin-by-pin lockpicking minigame played at the door handle. Used automatically while zyke_lockpick is started.
  • Skill check: a skill check followed by a progress bar. Used when zyke_lockpick isn't installed, or when forced in the config.

#Table of Contents


#Requirements

  • A lockpick item: veh_lockpick or veh_advancedlockpick by default.
  • A locked vehicle nearby. Using a lockpick on an unlocked vehicle shows "This vehicle is already unlocked."
  • Standing next to the driver door.
  • Jamming the vehicle first if it is protected. See Signal Jammer.

#Lockpicking a Vehicle

#Stand at the driver door

Walk up to the front door of the locked vehicle.

#Use the lockpick

Your character crouches and starts working on the lock. An NPC sitting in the driver seat flees, and nearby peds within witnessDistance may witness the attempt.

#Complete the minigame

Either the zyke_lockpick minigame or the skill check runs, see below. Moving away from the door, ragdolling, falling or dying interrupts the attempt.

#Unlocked

The vehicle unlocks with the configured unlock sound. Get in and hotwire it to start the engine.


#Choosing the Minigame

lockpicking.minigame controls which style is used:

ValueBehavior
autoPlays the zyke_lockpick minigame while zyke_lockpick is started, otherwise the skill check. Default.
skillcheckAlways plays the skill check, even if zyke_lockpick is started.

No other setup is needed. Vehicle Keys checks whether zyke_lockpick is started every time a lockpick is used, so ensuring it in your server.cfg is enough:

cfg
ensure zyke_lib
ensure zyke_lockpick
ensure zyke_vehiclekeys

#zyke_lockpick Minigame

The lock floats just outside the front door handle closest to the player, and the player picks it pin by pin.

  • lockpicking.pins sets the number of pins, from 3 to 9 (default 6).
  • zyke_lockpick requires its tension wrench, and the lockpick item must be listed in zyke_lockpick's Config.Items. If either is missing, zyke_lockpick notifies the player and the attempt doesn't start.
  • zyke_lockpick owns the pick's wear and breaking. Vehicle Keys' itemUsageMode, the item durability, breakChance, failChance and timeToLockpick values don't apply in this mode.
  • The result is confirmed by zyke_lockpick's server before the vehicle unlocks.

Because veh_lockpick and veh_advancedlockpick must be listed in zyke_lockpick's Config.Items, make sure you add them there if you use zyke_lockpick.


#Skill Check

Without zyke_lockpick, or with minigame = "skillcheck":

  1. A skill check runs through each difficulty in lockpicking.skillCheck in order. false skips it.
  2. A progress bar runs for timeToLockpick seconds, multiplied by the item's timeMultiplier. You can cancel it.
  3. On a failure, the item loses durability or may break depending on itemUsageMode:
ModeBehavior
durabilityRemoves durability.success or durability.failure. At 0 durability the lockpick breaks.
breakOnFailEach failure has a breakChance percent chance to break the lockpick.
disabledThe lockpick is never damaged.

failChance makes a successful attempt fail anyway, and breakOnChanceFailure decides whether such a forced failure can also break the pick.

Cancelling the progress bar yourself has no penalty.


#Vehicle Restrictions

lockpicking.restrictedVehicles blocks lockpicking per vehicle type. true means the type can't be lockpicked.

TypeVehiclesDefault
tempTemporary-key vehicles and NPC vehiclesAllowed
personalPlayer-owned vehiclesAllowed
professionJob vehiclesBlocked

With blockInGarageSections enabled, lockpicking is also blocked inside Zyke Garages sections.

For anything else, edit CanLockpickKeyVehicle in the client or server hooks. See Integration Hooks.


#Dispatch & Logs

When the attempt starts, OnKeyRobbery is called with type = "lockpick" and stage = "started", and the ped witness check uses lockpicking.witnessDistance (default 15.0). Add your dispatch alert to the hook in server/unlocked/hooks.lua.

A successful lockpick is logged through LogKeyAction.


#FAQ

Q: Do I need zyke_lockpick? No. Without it, the skill check is used.

Q: I have zyke_lockpick but players still get the skill check. Make sure lockpicking.minigame is "auto" and that zyke_lockpick is started.

Q: The lockpick does nothing with zyke_lockpick started. The player is probably missing the tension wrench, or the lockpick item isn't in zyke_lockpick's Config.Items.

Q: Why aren't my durability settings applied? They only apply to the skill check. With zyke_lockpick, configure wear in zyke_lockpick.

Q: Why does it say I need to jam the signal first? The vehicle is protected by its class or a security module. See Signal Jammer.