[Release] MSK VehicleKeys - Unique Items & In-Game Admin Dashboard (no config editing) [ESX/QBCore] | v3.1.1

A complete vehicle key system for ESX and QBCore. (Un)lock vehicles with a command, hotkey or target, hand out unique key items, and manage everything live from a built-in in-game admin dashboard. No config file editing and no restart needed.

Tebex [19.99€ incl. VAT] - about 80% is encrypted
Tebex [39.99€ incl. VAT] - about 10% is encrypted

MSK VehicleKeys - Documentation

Description

  • (Un)lock a vehicle with Command, Hotkey or Target → (ox_target)
  • Choose on which seat you want to sit with Target → (ox_target)
  • Open Keys Menu with Command and Hotkey (menu and context menu from ox_lib)
  • Admin Command to (un)lock a vehicle without a key needed
  • Primary, Secondary and Temporary Keys
  • Keys as unique items (every vehicle is a unique key item, except job vehicles)
  • Job Vehicle Keys (players with specific jobs can (un)lock vehicles with specific plates or a specific model)

  • Whitelist for vehicles (models and plates you don’t need a key for)
  • Blacklist for vehicles (models and plates that can never be (un)locked)
  • Admin Vehicles (admins with the right group can use the hotkey to (un)lock them)
  • Exchange Vehicle Locks (all keys other players might have get deleted, done at a locksmith)
  • Transfer Vehicle (transfer ownership to another player)
  • Keyring System (save all keys in a second inventory) → [only ox_inventory (Inventory Support below)]

  • Lock NPC vehicles with the option to carjack closed NPC vehicles (configurable)
  • Everything is stored in the database (MariaDB via oxmysql), the tables are created automatically on the first start
  • Multi-language (English, German and Hungarian included, easy to add your own)

In-game Admin Dashboard

Since v3.0 VehicleKeys ships with its own admin dashboard. Open it in-game with /advehiclekeys (the command is configurable). Everything you used to change in the config now lives in the database and can be edited live, without a restart.

  • Players & Keys → hand out or take keys, see who owns a plate and who is carrying a key for it, and use a normal refresh or a force refresh that gives a player every missing key item back
  • Vehicles / Plates → look up any plate and the keys tied to it
  • Locksmith → add, edit and delete locksmith spots, the peds and blips update instantly
  • Access lists → edit your whitelist, blacklist, admin vehicles and job vehicles right from the UI, models can be written as spawn names like police
  • Settings → change the in-game settings and recolor the dashboard with the built-in theme editor
  • Permissions → give your team access with a group based rights system
Screenshot: Players & Keys tab

Screenshot: Access lists (whitelist / blacklist / job vehicles)


Screenshot: Settings & theme editor



Permissions & luxu_admin

You can give your staff access to the dashboard without handing them full server access. Every group gets its own set of rights, group.admin can always do everything and group.user can never get in. Membership is resolved through a FiveM ACE principal, your framework group, or a luxu_admin staff group.

luxu_admin is supported out of the box and auto-detected, so your luxu staff can open the dashboard without setting up FiveM ace permissions. You can require staff to be on duty and map luxu group names onto your own dashboard groups.

Screenshot: Permissions tab

Config

If you want to look at the config first, check the documentation. We keep it up to date there.

MSK VehicleKeys - Config

Inventory Support

You must have one of the inventories listed below.

Attention

We recommend ox_inventory or jaksam_inventory for unique items, because with it we can add or remove the player’s key automatically when the item is dropped, given away and so on (except TempKeys, they get removed on reconnect).
The Keyring System is also only available for ox_inventory and jaksam_inventory.

EngineToggle Support

We recommend msk_enginetoggle, but you can use any EngineToggle script you like.

For EngineToggle scripts, please use these exports:

Requirements

Optional Requirements

Changelog

The full changelog is in the documentation:

MSK VehicleKeys - Changelog

Code is accessible No
Subscription-based No
Lines (approximately) ~8.500
Requirements Read Requirements above
Support Yes

My other Scripts

Paid

Free

3 Likes

Hello,
I have some questions for this script:

  • Can we open/close the vehicle with ox_target? Without using a shortcut/keyboard command
  • Does it manage the lock of all NPC vehicles
  • Does it manage the possibility of carjacking closed vehicles?
  • Possibility to add a key ring system managed in container with ox_inventory?

Hey, those are great suggestions :slight_smile:

  • Does it manage the lock of all NPC vehicles

Yes it does.

  • Can we open/close the vehicle with ox_target? Without using a shortcut/keyboard command
  • Does it manage the possibility of carjacking closed vehicles?
  • Possibility to add a key ring system managed in container with ox_inventory?

Not yet but I will add that in a future update.

I would wait for this update before purchasing.

Update v1.2.0

  • Added Config.VehicleTarget to (Un)lock a vehicle with a Target System
  • Added Probability for lockVehiclesFromNPCs whether a vehicle is open
  • Added Keyring System for ox_inventory
  • Added Select Seat for ox_target
  • Added Config.AdminVehiclesAdmins can use the Hotkey to (un)lock those vehicles
  • Added new Translations in translation.lua

Idk if you are gonna reply but could you make a youtube preview or something so i can see the script before i buy it

any preview?

Update for msk_vehiclekeys v1.3.8

Changed files: fxmanifest.lua, server/encrypted.lua, server/functions.lua

  • Added validation of vehicle keys before saving — prevents null or invalid entries from being written to vehiclekeys.json
  • Added automatic backup file (vehiclekeys_backup.json) — created before every save and used as fallback if the main file gets corrupted
  • Added safe load on resource start with pcall — tries vehiclekeys.json, then backup, then empty table
  • Improved AddKey function to abort cleanly with a logged error instead of leaving partial entries in memory
  • Some Bugfixes and code improvements

Updated Tebex and documentation Links

Update v2.0.0

  • Storage: JSON file to MariaDB (msk_vehiclekeys_keys) with in-memory cache and write-through, schema creation and JSON import run automatically on first start.
  • New modules: storage.lua, inventory.lua, utils.lua, a clean separation instead of a monolith, with an explicit load order in fxmanifest.lua.
  • Inventory: unified interface, now only ox_inventory and jaksam_inventory (dropped: core_inventory, qs-inventory).
  • Key transfer: seller-availability and distance checks (new translations transfer_seller_unavailable, transfer_too_far).
  • Fixes: playerCoords nil crash, GetClosestEntityWithPlate nil guard, cooldown memory leak.
  • Removed: encrypted.lua, ox_inventory.lua, vehiclekeys.json.
  • Breaking: v1 to v2, JSON storage and part of the inventory support are gone.

v3.1.1

Fixed

  • Key hand-outs were broken since v3.0 for garage and shop integrations that give you a key through the client exports. Taking your own vehicle out of the garage would say “This vehicle doesn’t belong to you!” and give no key. Two separate things were behind it.

  • First, the check that guards giving out a key also demanded that the owner was already carrying the key item. That item rule belongs to locking and unlocking, not to receiving a key, so an owner taking their car out of the garage with no key yet got rejected and could never get the first one. Giving yourself a key for a car you own no longer needs you to already hold the item.

  • Second, when a key was already saved in the database but the item was missing from the inventory, the script stopped early and gave nothing back. It now notices the missing item and hands it back, the same way the force refresh does.

  • On top of that the owner check trims the plate before matching, so plates saved with extra spaces (ESX default) are recognised, and giving yourself a key keeps the type you asked for, primary included. Sharing a key with another nearby player stays limited to secondary and temporary keys.

This is a server-side fix, so there is nothing to rebuild. On the client exports, primary and secondary keys can be added when the player owns the vehicle or already holds a key for it, while temporary keys can be added for any vehicle since they are removed again on reconnect. Server scripts can always hand out keys through the server export exports.msk_vehiclekeys:AddKey(...), which is not restricted.

v3.1.0

New

  • luxu_admin support. The admin dashboard now works with luxu_admin out of the box. luxu_admin keeps its staff groups internally instead of using FiveM ace permissions, so the dashboard reads a player’s staff group straight from luxu_admin and matches it to your dashboard groups by name. A luxu group called admin gets full access, and any other group works like a normal dashboard group. You can turn it on or off, require staff to be on duty, and map luxu group names to your own groups in config/static.lua (Config.LuxuAdmin). It is auto-detected, so it stays off when luxu_admin is not running.

v3.0.0

This is a big one. VehicleKeys now comes with its own in-game admin dashboard, and most of the config moves into the database so you can manage everything while the server is running.

New

  • Admin dashboard. Type /advehiclekeys in-game to open it. From there you can hand out or take keys, look up who owns a plate and who is carrying a key for it, set up locksmiths, edit your whitelist, blacklist and job vehicles, change the settings and decide who else is allowed in. You can rename the command with Config.adminCommand.

  • Permission system. You can give your team access to the dashboard without handing them the keys to everything. Every group gets its own set of rights. group.admin can always do it all and group.user can never get in. You manage the groups from the Permissions tab, and Config.dashboardGroups decides which groups may open the dashboard at all.

  • Force refresh. On the Players tab you get a normal refresh and a force refresh. The force one gives the player every missing key item back, even if you normally keep item handouts turned off for realism.

  • Owner needs item (optional). New option Config.Settings.key.ownerNeedsItem. Turn it on if you want the vehicle owner to carry the key item as well. It is off by default, so your current setup does not change unless you enable it.

  • Theme editor. You can recolor the dashboard live from the Settings tab.

Changed

  • Everything runs off the database now. The config is imported once on the first start, and after that the database is the source of truth and you edit things from the dashboard. Three tables are created automatically for this: msk_vehiclekeys_settings, msk_vehiclekeys_permissions and msk_vehiclekeys_locksmiths. Your existing msk_vehiclekeys_keys table stays exactly as it is.

  • Config was split into two files. config/settings.lua holds all the values you can also change in the dashboard, and config/static.lua holds the code parts like the framework detection, the notification and the TextUI. Config.Framework moved into config/static.lua.

  • Vehicle models are written as names now. In the whitelist, blacklist, admin vehicles and job vehicles you can just write the spawn name like 'police' instead of a hash. Old hash entries still work, so you do not have to change anything if you do not want to.

  • Locksmiths are managed from the dashboard. The spots in the config are only the starting point. After that you add, edit and delete them from the Locksmith tab, and the peds and blips update right away without a restart.

Security

  • Closed a few holes where players could mess with keys they should not touch. Giving out a key, taking a key, exchanging locks and transferring a vehicle now check that you actually own the car and that the other player is standing next to you. The lookups that used to leak other players’ keys were tightened as well.

Breaking

  • config.lua is gone and replaced by the config/ folder. Please give your config a quick look after updating and move any custom values over to config/settings.lua (or config/static.lua for the code parts).

  • Vehicle models in the lists are spawn names now. Your old backtick hashes keep working, so this only matters if you want the cleaner look.