Installation
Steps
- Drag & drop the
msk_vehiclekeysfolder into your resources directory. - Add
ensure msk_vehiclekeysto yourserver.cfg. - Make sure all dependencies start before
msk_vehiclekeys. - Configure
config.lua. - Set your framework at
Config.Framework(or leave it onAUTO). - Set the hotkeys you want — players can rebind them in the FiveM keybind settings.
- Add the items (
keys,keyring,contract) to your inventory. - Enable or disable
uniqueItemsdepending on your inventory.
oxmysql, ox_lib and msk_core must be started before msk_vehiclekeys.
Database
Vehicle keys are stored in a MariaDB table (msk_vehiclekeys_keys). The table is created
automatically on first start — no manual SQL import is required.
If you are updating from a version that used vehiclekeys.json, the keys are imported into
the database automatically and only once on the first start. The old vehiclekeys.json
file is no longer used afterwards and can be deleted.
Items
Add these items to your inventory (names can be changed in config.lua):
| Item | Config option | Purpose |
|---|---|---|
keys | Config.Settings.key.itemName | The vehicle key item |
keyring | Config.KeyRingSystem.item | Opens your keyring (ox_inventory & jaksam_inventory only) |
contract | Config.Settings.transfer.itemName | Sell / transfer your vehicle to another player |
ox_inventory
Add to ox_inventory/data/items.lua:
["keys"] = {
label = "Vehicle Key",
description = "Key for a Vehicle",
weight = 35,
stack = false,
close = true,
client = {
export = 'msk_vehiclekeys.toggleLock'
},
},
["contract"] = {
label = "Contract",
description = "Contract to sell your vehicle",
weight = 10,
stack = true,
close = true,
client = {
export = 'msk_vehiclekeys.openDialog'
},
},
["keyring"] = {
label = "Vehicle Keyring",
description = "Keyring for your Vehicle Keys",
weight = 10,
stack = false,
close = false,
consume = 0,
},
For the Keyring System, add to ox_inventory/modules/items/containers.lua:
setContainerProperties('keyring', {
slots = 500,
maxWeight = 100000,
whitelist = { 'keys' }
})
jaksam_inventory
Add the keys, contract and keyring items to your jaksam_inventory items list.
- The items must be set as unique / metadata items (the script writes the plate into the item's metadata).
- Mark
keysandcontractas usable so they can trigger thetoggleLock/openDialogexports.
Inventory Note
Vehicle keys are metadata-based unique items. Only ox_inventory and jaksam_inventory
are supported. Support for qs-inventory and core_inventory was removed in v2.0.0.