Vehicle MinigamesEvents and exports

Events and exports

Hook Vehicle Minigames into police alerts, logs, XP or stress.

On this page

Server events

Alarm

Fires when a pick snaps (reason = 'failed') or an alarmed car is opened after being picked (reason = 'opened'). Use it for police alerts.

server.lua
AddEventHandler('tr_minigames:lockpick:alarm', function(src, netId, coords, reason)
    -- src: the player, netId: the car, coords: where it is
end)

Lock picked

Fires when a player picks a lock and the door unlocks. Use it for logs, XP or stress.

server.lua
AddEventHandler('tr_minigames:lockpick:picked', function(src, netId, plate)
end)

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()

State bags

StateSet onMeaning
tr_hotwiredThe cartrue once it's been hotwired
tr_hotwire_coverThe cartrue while its column cover is off
tr_lock_jamThe carThe time (os.time) a snapped pick tip stops jamming its lock
client.lua
if Entity(vehicle).state.tr_hotwired then
    -- this car was hotwired
end

Still stuck? Open a ticket on Discord.