Skip to main content

Exports

FR Carlock exposes four client-side exports to integrate with your dealership, job or mission scripts.

GiveKeys

Give the local player keys for a plate.

exports['fr_carlock']:GiveKeys('46EEK572')

RemoveKeys

Remove the local player's keys for a plate.

exports['fr_carlock']:RemoveKeys('46EEK572')

HasKeys

Returns true if the player holds keys for that plate.

local hasKeys = exports['fr_carlock']:HasKeys('46EEK572')
if hasKeys then
-- player can operate the vehicle
end

Toggle

Lock/unlock the nearest or current vehicle from code.

exports['fr_carlock']:Toggle()

Integration example

-- When a purchase is completed
RegisterNetEvent('fr_dealership:onVehiclePurchased', function(plate)
exports['fr_carlock']:GiveKeys(plate)
end)

Notes

  • All exports are client-side — call them from client scripts.
  • Keys are stored in local memory. They are cleared when the player disconnects.
  • For persistence across sessions, store ownership in your database and grant keys on player spawn.