Agency-Vehiclekeys V2 Installation
Universal vehicle keys for FiveM on QBCore, Qbox, ESX or fully standalone.

01Installation
- 1Put Agency-Vehiclekeys into your resources folder
- 2Add ensure Agency-Vehiclekeys to server.cfg, after your framework, oxmysql and your inventory
- 3Stop other key scripts such as qb-vehiclekeys. Their key events are understood, so garages and shops keep working
- 4Lockpick items: most QBCore servers have lockpick and advancedlockpick already, otherwise see install/items_qbcore.lua, install/items_ox_inventory.lua or install/items_esx.sql
- 5Optional: add_ace group.admin agency.vehiclekeys.admin allow for the Admin and Settings tabs of /keys
- 6Updating from V1: replace the old folder and use the new config.lua. Keys handed out in V1 (simple_carkeys_shared) are taken over on the first start
02Dependencies
No dependency requiredQBCore, QBox or ESX (optional, runs standalone without one)oxmysql (optional, without it the keys are saved in the server's key value store)An inventory for lockpicks (optional: ox_inventory, qs-inventory, qb-inventory and its forks or ESX)A dispatch script (optional: ps-dispatch, cd_dispatch, qs-dispatch, rcore_dispatch, core_dispatch, tk_dispatch or lb-tablet)Agency-Notify (optional, messages in the classic V1 look)
03SQL File
Optional: the resource creates these tables on its own when it starts. Import this file only if you set up the database by hand:
-- Agency Vehiclekeys V2
-- Optional: the script creates this table by itself on the first start when
-- oxmysql runs. Run it by hand only if your database user may not create tables.
CREATE TABLE IF NOT EXISTS `agency_vehiclekeys` (
`plate` VARCHAR(16) NOT NULL,
`identifier` VARCHAR(96) NOT NULL,
`kind` VARCHAR(12) NOT NULL DEFAULT 'shared',
`holder` VARCHAR(64) NULL DEFAULT NULL,
`granted_by` VARCHAR(96) NULL DEFAULT NULL,
`model` VARCHAR(32) NULL DEFAULT NULL,
`created` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`plate`, `identifier`),
KEY `identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+Good to know
Agency-Vehiclekeys V2 works right after the ensure line. Five points are worth a look before the first start: other key scripts, the lockpick items, the database, admins and job keys, and the step from V1.
- Other Key Scripts
- Stop qb-vehiclekeys, qbx_vehiclekeys and similar scripts, two key scripts would fight over the same cars. Their key events are understood, so garages and shops keep working. A script that calls exports['qb-vehiclekeys']:HasKeys(plate) on the client only needs the name changed to Agency-Vehiclekeys.
- Lockpick Items
- Config.Lockpick.items names the items, by default advancedlockpick and lockpick. Most QBCore servers have both. install/items_qbcore.lua, install/items_ox_inventory.lua and install/items_esx.sql contain the entries for the other inventories. Using the item from the inventory starts a try, H does the same.
- Database
- With oxmysql the keys are saved in the table agency_vehiclekeys, which the script creates by itself. Without oxmysql they go to the server's key value store. install/agency_vehiclekeys.sql is only needed when your database user may not create tables.
- Admins and Job Keys
- Admins are players with the ACE agency.vehiclekeys.admin, group.admin or group.superadmin, or a group from Config.AdminGroups. On standalone servers job keys come from ACE permissions, for example add_ace group.police agency.vehiclekeys.police allow.
- Updating from V1
- Replace the old folder with the new one and use the new config.lua, the V1 config does not fit. Keys from simple_carkeys_shared are taken over on the first start. G still locks, the engine moved from M to U, and /givekey and /removekey still work.
?Frequently asked questions
Which inventories are supported for lockpicks?
ox_inventory, qs-inventory, qb-inventory and its forks, and the ESX inventory, found by Config.Inventory = 'auto'. Standalone servers without an inventory can connect their own with Config.Standalone.itemCount and removeItem, or let players pick without an item.
My garage uses its own table for owned vehicles. What do I do?
Set Config.OwnedVehicles to the table and its columns for the owner and the plate. By default player_vehicles with citizenid (QBCore, Qbox) and owned_vehicles with owner (ESX) are used.