Skip to content

FWB Vehicle Keys β€” Installation ​

Dependencies ​

ResourceRequiredNotes
oxmysqlYesThe database. Tables are created on first start; there is nothing to import.
FrameworkYeses_extended, qb-core or qbx_core.
InventoryOptionalNeeded for keys as items (the key carries its plate): ox_inventory, qb-inventory / ps-inventory / lj-inventory, qs-inventory or codem-inventory. Without one, keys are saved keys.
TargetOptionalox_target, qb-target or sleepless_interact for the locksmith. Without one, a "[E]" 3D text is used.
DispatchOptionalcd_dispatch, ps-dispatch, qs-dispatch, rcore_dispatch or core_dispatch. Without one, the built-in alert is used.
ox_lib, ps-uiOptionalOnly if you want their minigames instead of the built-in ones.

[Install_me_first] ​

PathWhat it is
items/ox_inventory.luaItem entries for ox_inventory/data/items.lua
items/qb-inventory.luaItem entries for qb-core/shared/items.lua (qb / ps / lj-inventory)
items/qs-inventory.luaItem entries for qs-inventory/shared/items.lua
items/esx.sqlESX without an inventory script (tools only; keys are saved keys there)
images/Item pictures (from items.rainmad.com): vehiclekey, carlockpick, advancedlockpick, tracker, scanner, pliers

Install Steps ​

  1. Create a category folder named [fs] inside your server's resources/ directory if you haven't already (resources/[fs]/).
  2. Place the fwb_vehiclekeys folder into resources/[fs]/fwb_vehiclekeys.
  3. Remove or stop any other vehicle keys resource (qb-vehiclekeys, qbx_vehiclekeys, wasabi_carlock…) so two key scripts don't fight over the same cars. Scripts that call those keep working: see Integrations.
  4. Add the items and pictures (Items below).
  5. Add the resource to your server.cfg after your framework, inventory and oxmysql:
lua
ensure oxmysql
ensure es_extended      # or qb-core / qbx_core
ensure ox_inventory     # your inventory
ensure fwb_vehiclekeys
  1. Give yourself admin access (Admin Access) and restart the server.
  2. In game, run /fwb_vehiclekeys. The Overview page shows what was detected and what is still missing.

Items ​

ItemWhat it is
vehiclekeyA key with the plate on it (only with an inventory that keeps data on items)
carlockpickOpens a locked car door, with some luck
advancedlockpickA better pick: higher chance, breaks less
trackerA GPS tracker: planted on a car, it shows the holder where the car is
scannerA handheld scanner that finds a tracker hidden on a car
pliersCuts a tracker off a car

The names can be changed in game: Settings β†’ General (key item), Car theft β†’ Lockpicks and Settings β†’ Trackers. If you rename one, rename it in your inventory too. Overview β†’ Items in the inventory tells you which are still missing.

ox_inventory (ESX / Qbox)

Paste [Install_me_first]/items/ox_inventory.lua into ox_inventory/data/items.lua:

lua
['vehiclekey'] = {
    label = 'Vehicle key',
    weight = 50,
    stack = false,
    close = true,
    description = 'A key with a number plate on it',
},
['carlockpick'] = { label = 'Car lockpick', weight = 100, stack = true, close = true },
['advancedlockpick'] = { label = 'Advanced lockpick', weight = 150, stack = true, close = true },
['tracker'] = { label = 'GPS tracker', weight = 80, stack = true, close = true },
['scanner'] = { label = 'Tracker scanner', weight = 200, stack = true, close = true },
['pliers'] = { label = 'Pliers', weight = 150, stack = true, close = true },

Pictures: copy [Install_me_first]/images/*.png into ox_inventory/web/images/.

qb-inventory / ps-inventory / lj-inventory (QBCore)

Paste [Install_me_first]/items/qb-inventory.lua into qb-core/shared/items.lua.

Pictures: copy the images into qb-inventory/html/images/ (or ps-inventory/html/images/, lj-inventory/html/images/).

qs-inventory

Paste [Install_me_first]/items/qs-inventory.lua into qs-inventory/shared/items.lua.

Pictures: copy the images into qs-inventory/html/images/.

codem-inventory

Use items/qb-inventory.lua (QBCore) or items/esx.sql (ESX) for your framework's item list.

Pictures: copy the images into codem-inventory/html/itemimages/.

ESX without an inventory script

Run [Install_me_first]/items/esx.sql on your database:

sql
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
  ('carlockpick', 'Car lockpick', 1),
  ('advancedlockpick', 'Advanced lockpick', 1),
  ('tracker', 'GPS tracker', 1),
  ('scanner', 'Tracker scanner', 1),
  ('pliers', 'Pliers', 1);

The ESX default inventory can't keep a plate on an item, so keys are saved keys (no key item).

Restart the inventory (or the server) after adding the items.


Admin Access ​

The fwb_vehiclekeys.admin ACE is the only admin check. Without it, typing /fwb_vehiclekeys in game shows a screen with your own server.cfg line (license filled in) and a copy button.

lua
# Give it to an admin group:
add_ace group.admin fwb_vehiclekeys.admin allow

# Or to a single player:
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx fwb_vehiclekeys.admin allow

The command name and the ACE can be renamed in Settings β†’ Commands.


Where Settings Are Saved ​

Everything is stored in your database through oxmysql. The tables are created on first start:

TableWhat it holds
fwb_keys_configSettings, locksmith places, job key rules
fwb_keysSaved keys (spares, temporary keys)
fwb_keys_locksLock version per plate (changed locks)
fwb_keys_trackersGPS trackers
fwb_keys_logCar history (who locked, drove, hotwired…)
fwb_keys_platesPlate changes (for the cooldown)

FWB Studio documentation.