Fires when a pick snaps (reason = 'failed') or an alarmed car is opened after being picked (reason = 'opened'). tr_minigames sends its own police alert for it; use this for anything else.
server.lua
AddEventHandler('tr_minigames:lockpick:alarm', function(src, netId, coords, reason) -- src: the player, netId: the car, coords: where it isend)
Lock picked
Fires when a player picks a lock and the door unlocks. Use it for logs, XP or stress.
Fires when a player finishes siphoning a car. Use it for logs, XP or police alerts.
server.lua
AddEventHandler('tr_minigames:siphon:siphoned', function(src, netId, plate, litres, spilled) -- litres: what went into the can, spilled: what ended up on the groundend)
Exports
Start lockpicking
Starts lockpicking for the player, at the nearest locked door in reach. This is what the lishi_pick item calls when it's used from ox_inventory.
client.lua
exports.tr_minigames:lockpick()
Start siphoning
Starts siphoning at the car the player stands at. This is what the siphon_hose item calls when it's used from ox_inventory.
client.lua
exports.tr_minigames:siphon()
State bags
State
Set on
Meaning
tr_hotwired
The car
true once it's been hotwired
tr_hotwire_cover
The car
true while its column cover is off
tr_lock_jam
The car
The time (os.time) a snapped pick tip stops jamming its lock
tr_siphoned
The car
The time (os.time) it can be siphoned again
client.lua
if Entity(vehicle).state.tr_hotwired then -- this car was hotwiredend