Mechanical lockpicking
Last updated
May be stale
This page was last updated ago, on 25 August 2026. Check what it says against the code before relying on it.
Primary lockpicking through the existing cityrp_lockpick SWEP uses a server-authoritative mechanical minigame. No separate lockpicking plugin is registered.
Controls
- Use
A/Dor the left/right arrow keys to position the pick. - Follow the highlighted curved arrow towards the server-authoritative sweet spot.
- Hold
Wor primary fire to apply tension and turn the barrel. - Release tension when the pick begins bending.
- Use secondary fire or Escape to cancel.
The player view and movement are held in place while the minigame is active.
Server authority
The server stores the target entity, hidden sweet-spot angle, barrel rotation, pick durability, timeout and difficulty profile. Clients submit only their requested pick angle and tension state. The server returns only a left, right or aligned hint; the hidden sweet-spot angle is never networked. Input changes are rate-limited before being applied.
The session ends when the player dies, is knocked out or arrested, changes weapon, moves out of range, allows a target vehicle to move, loses the target or exceeds the time limit.
Pick damage and failure
Turning the barrel at the wrong pick angle limits barrel travel and damages the pick once enough pressure is applied. A snapped pick consumes exactly one cityrp_lockpick item and immediately closes the current minigame.
When another pick remains, the player may begin a fresh attempt with that pick. The third snapped pick jams the target for 30 seconds. When no picks remain, the weapon is stripped and keys are selected.
Vehicle failures have an escalating chance to sound the existing vehicle alarm. The alarm has a vehicle-level cooldown, so repeated failures cannot stack the sound. Successful attempts reset that vehicle's accumulated alarm failures.
Difficulty
Default doors and vehicles use Standard difficulty, while vehicle clamps use Easy difficulty. Active Car Boosting vehicles inherit difficulty from their contract class:
| Contract class | Difficulty |
|---|---|
| D | Easy |
| C | Standard |
| B | Hard |
| A | Very Hard |
| S | Extreme |
Higher difficulties narrow the valid pick angle, increase damage, slow the barrel and reduce the attempt timeout.
Other systems may override the profile through CityRP.LockpickDifficulty. The SWEP emits CityRP.LockpickSucceeded, CityRP.LockpickFailed and CityRP.LockpickSnapped hooks.
Vehicle ignition
Opening a vehicle lock does not automatically bypass an engine that its owner left switched off. When a player without vehicle access later requests an engine start, the existing Vehicles plugin opens the general wire-matching hotwire task documented in Vehicle hotwiring and wire puzzles.
Preserved behaviour
Secondary-fire vehicle and government-locker looting remains timed and uses its existing loot tables and cooldowns. Handcuff release also retains its existing ten-second interaction.
Developer commands
Developer-only commands are registered from the existing SWEP:
/lockpicktest <D|C|B|A|S|easy|medium|hard|veryHard|extreme> [angle]
/lockpicksessions
/lockpicktest configures the next attempt and may set a known sweet-spot angle for repeatable testing. /lockpicksessions prints active sessions, targets, difficulty, durability and snap count to the console.
Runtime test plan
- Confirm doors, standard vehicles and clamps open only after a full successful barrel turn.
- Confirm A/D and both arrow keys position the pick without rotating the player's camera.
- Confirm W and primary fire apply tension, rotate the barrel and return it to rest when released.
- Confirm the keyway, screwdriver shaft, elbow and handle rotate together with the barrel.
- Confirm the highlighted arrow points towards the sweet spot and changes to aligned inside the valid region.
- Hold tension at a clearly wrong angle and confirm condition falls, exactly one item is consumed and the minigame closes on snap.
- Confirm another inventory pick permits a fresh attempt and the final pick strips the SWEP.
- Snap three picks against one target and confirm the lock jams for 30 seconds.
- Confirm repeated vehicle failures do not stack the alarm sound.
- Confirm increasing Car Boosting classes produce visibly narrower and less forgiving attempts.
- Confirm a boosting vehicle advances through the existing
CityRP.LockpickSucceededintegration. - Confirm a player without vehicle access must hotwire a vehicle whose engine is off after the lock is opened.
- Confirm secondary vehicle/locker looting and handcuff release still work unchanged.