Documentation

Garage Integration

Integrate Vehicle Keys with Zyke Garages or another garage resource.

Vehicle Keys does not require a garage. Without a provider, its menu lists accessible vehicles that currently exist in the world and supports plate-based lock and engine actions.

#Zyke Garages

Set the Vehicle Keys provider in zyke_lib/dependency_override.lua:

lua
vehicleKeys = "zyke_vehiclekeys",

Start the resources in this order:

cfg
ensure zyke_lib
ensure zyke_vehiclekeys
ensure zyke_garages

The integration keeps responsibilities separate:

GaragesVehicle Keys
VIN, ownership, garage entitlement, finance, impounds, persistent state, and storagePhysical or identifier keys, temporary access, lock and engine controls, key fob, theft, and compatibility
Converts its VIN to the canonical real plate before calling the key providerUses the canonical plate as its only vehicle identity
Supplies persistent and stored vehicle rows, GPS, summon, ownership, and replacement-key actionsDisplays and executes the supported provider actions

When Vehicle Keys is first used with a current Garages installation, Garages imports legacy access, frequency, and key-counter values only where Vehicle Keys does not already have a plate row. Existing standalone Vehicle Keys data is not overwritten.

#Garages With Another Key System

Garages 2.6.0 can use these providers through zyke_lib:

  • zyke_vehiclekeys
  • qb-vehiclekeys
  • qbx_vehiclekeys
  • qs-vehiclekeys
  • wasabi_carlock

Select the provider with vehicleKeys in zyke_lib/dependency_override.lua. Garages requires give, remove, and access checks. Optional features are shown only when the selected provider advertises the matching capability.

#Vehicle Keys With Another Garage

Any garage can use the server exports to give, remove, and check plate-based access.

At minimum, a garage normally calls:

lua
exports["zyke_vehiclekeys"]:GiveKey(playerId, plate)
exports["zyke_vehiclekeys"]:RemoveKey(playerId, plate)
exports["zyke_vehiclekeys"]:HasKey(playerId, plate)

Persistent vehicle resources should also call:

  • SetAccess when their ownership or shared-access list changes.
  • SetTemporaryAccess to restore provider-owned runtime access in identifier mode.
  • RenamePlate after a permanent plate change.
  • DeleteVehicle after permanent deletion.
  • ImportVehicleState for a one-time, non-destructive migration.

#Optional Vehicle Menu Provider

Set Config.Settings.vehicleActions.menuProvider to a resource that supplies persistent menu rows:

lua
vehicleActions = {
    menuProvider = "my_garage",
}

The provider can expose:

lua
exports("GetVehicleKeyMenuVehicles", function()
    return {
        {
            plate = "ABC123",
            displayPlate = "ABC123",
            modelName = "Sultan",
            icon = "car",
            netId = 1,
            pos = vector3(0.0, 0.0, 0.0),
            providerId = "garage-owned-opaque-id",
            actionStates = {locked = false, engine = false, gps = false},
            supportedActions = {gps = true, summon = true},
        },
    }
end)

exports("PerformVehicleKeyMenuAction", function(providerId, action, desiredState)
    return action == "gps" or action == "summon"
end)

providerId stays opaque and never becomes key identity. Lock, engine, inventory, and access checks remain canonical-plate operations inside Vehicle Keys.