Item setup
Items for Vehicle Keys. Paste the matching file, then copy the PNGs.
Paste the matching file, then copy every PNG from [INSTALL]/images/ into your inventory images folder (Item images).
| Inventory | Paste into | Images |
|---|---|---|
| ox_inventory | ox_inventory/data/items.lua from [INSTALL]/items/ox_inventory_items.txt | ox_inventory/web/images/ |
| qb-core | qb-core/shared/items.lua from [INSTALL]/items/qb-core_items.txt | qb-inventory/html/images/ |
| one_inventory | [INSTALL]/items/one_inventory_items.txt, as its own server script that starts after one_inventory | one_inventory/web/images/ |
| Kora | [INSTALL]/items/kora_items.txt (the same records are in the Kora section below), added to KoraCoreSeed.items in kora_core/shared/items.lua | kora_inventory/images/ |
Required: set the inventory to one_inventory in the Newb_Bridge resource settings. one_inventory provides itself as ox_inventory and is not fully compatible with its image paths, so on "auto" item images do not load. See Newb_Bridge configuration.
Names have to stay as they are unless you also change them in /setupkeys. If you rename blank_key in the items file and forget the locksmith shop, the shop stops selling it.
Players do not craft vehiclekeys. Garages, the locksmith, and admin commands hand them out. The script fills in the plate when it gives the key. It also registers item use for the keys, the keyring, the paperwork and the other usable items itself, so the item definitions need no use handler.
| Item | What it is |
|---|---|
vehiclekeys | A key for one vehicle |
keyring | Holds several keys |
lockpick | Opens a locked door. Does not start the car |
advancedlockpick | Same idea, for cars that need the better pick |
hotwire_kit | Only used if hotwiring requires an item |
rental_paperwork | The paper that comes with a rental |
aftermarket_locks | Owner uses this to change the lock so old keys stop working |
blank_key | Uncut blank. Locksmiths burn one when they cut a key |
keyfob_scanner | The Pooper 9. Clones a nearby fob onto a blank, and scans a car to read its security, then bypasses its immobiliser or jams its tracker |
ping_transmitter | Stick this on a car with the target option |
ping_receiver | Use it to ping cars you have a tracker on |
alarm_module_linked | Fit beside a parked car. Its alarm also alerts the online owner |
alarm_module_dispatch | Fit beside a parked car. Its alarm alerts the owner and sends police dispatch |
ignition_cutoff_relay | Fit beside a parked car. Blocks hotwiring, and a valid key is still needed to start it |
keypad_cutoff_module | Fit beside a parked car. Blocks hotwiring and asks for a four digit PIN at every engine start. Turns remote start off |
gps_tracker_module | Fit beside a parked car. Fits a GPS tracker on it, which the jammer can silence and the removal kit can strip |
gps_signal_jammer | Silences a fitted tracker, and the wireless side of its alarm, for a while |
tracker_extraction_kit | Removes a fitted GPS tracker |
The seven security items are fitted from the inventory beside a parked, registered car with its engine off, and by default only by the mechanic and locksmith jobs (change this under Who can fit it on the Vehicle security page). Their pictures are alarm_module_linked.png, alarm_module_dispatch.png, ignition_cutoff_relay.png, keypad_cutoff_module.png, gps_tracker_module.png, gps_signal_jammer.png and tracker_extraction_kit.png, and ship in [INSTALL]/images.
On ox_inventory, vehiclekeys has two buttons. Throw Keys drops that key as a prop anyone can pick up. You have to be in a vehicle. Destroy Key deletes that one key. Spare copies you still have keep working. Thrown keys despawn after 30 minutes.
['vehiclekeys'] = {
label = 'Vehicle Keys',
weight = 50,
stack = false,
close = true,
description = 'Keys for a vehicle',
client = { image = 'vehiclekeys.png' },
buttons = {
{
label = 'Throw Keys',
action = function(slot)
exports.MrNewbVehicleKeys:ThrowKeys(slot)
end,
},
{
label = 'Destroy Key',
action = function(slot)
exports.MrNewbVehicleKeys:DestroyKey(slot)
end,
},
},
},The full lists are the files in [INSTALL]/items/: ox_inventory, one_inventory, qb-core and Kora.
Kora
On Kora, kora_inventory does not read ox_inventory/data/items.lua. Add these records to KoraCoreSeed.items in kora_core/shared/items.lua and copy the PNGs into kora_inventory/images/. Skip lockpick and advancedlockpick if Kora already defines them. A kora_core update can overwrite that file, so keep a copy of your additions. Kora has no item buttons, so the Throw Keys and Destroy Key buttons are not available there.
{ name = 'vehiclekeys', label = 'Vehicle Keys', weight = 50, type = 'item', image = 'vehiclekeys.png', unique = true, useable = false, shouldClose = true, description = 'Keys for a vehicle' },
{ name = 'lockpick', label = 'Lockpick', weight = 160, type = 'item', image = 'lockpick.png', unique = false, useable = false, shouldClose = true, description = 'A basic lockpick' },
{ name = 'advancedlockpick', label = 'Advanced Lockpick', weight = 160, type = 'item', image = 'advancedlockpick.png', unique = false, useable = false, shouldClose = true, description = 'An advanced lockpick for tougher locks' },
{ name = 'hotwire_kit', label = 'Hotwire Kit', weight = 200, type = 'item', image = 'hotwire_kit.png', unique = false, useable = false, shouldClose = true, description = 'Tools for bridging an ignition without a key' },
{ name = 'keyring', label = 'Keyring', weight = 100, type = 'item', image = 'keyring.png', unique = true, useable = true, shouldClose = true, description = 'Opens your keyring screen' },
{ name = 'rental_paperwork', label = 'Rental Paperwork', weight = 50, type = 'item', image = 'rental_paperwork.png', unique = true, useable = false, shouldClose = true, description = 'Rental agreement for a vehicle' },
{ name = 'aftermarket_locks', label = 'Aftermarket Lock System', weight = 500, type = 'item', image = 'aftermarket_locks.png', unique = false, useable = false, shouldClose = true, description = 'Install a new lock code on a vehicle you own' },
{ name = 'blank_key', label = 'Blank Key', weight = 50, type = 'item', image = 'blank_key.png', unique = false, useable = false, shouldClose = true, description = 'An uncut key blank for programming at a locksmith bench' },
{ name = 'keyfob_scanner', label = 'Pooper 9', weight = 200, type = 'item', image = 'keyfob_scanner.png', unique = true, useable = false, shouldClose = true, description = 'Clones rolling codes onto blank keys, and scans or tampers with vehicle security.' },
{ name = 'ping_transmitter', label = 'Ping Transmitter', weight = 150, type = 'item', image = 'ping_transmitter.png', unique = false, useable = false, shouldClose = true, description = 'Player ping GPS. Install on a vehicle via target while in inventory.' },
{ name = 'ping_receiver', label = 'Ping Receiver', weight = 200, type = 'item', image = 'ping_receiver.png', unique = true, useable = false, shouldClose = true, description = 'Ping the approximate location of vehicles you planted a transmitter on.' },
{ name = 'gps_tracker_module', label = 'Police GPS Module', weight = 150, type = 'item', image = 'gps_tracker_module.png', unique = false, useable = false, shouldClose = true, description = 'Fits a GPS tracker on a car. Not the player ping transmitter.' },
{ name = 'alarm_module_linked', label = 'Linked Alarm Module', weight = 200, type = 'item', image = 'alarm_module_linked.png', unique = true, useable = false, shouldClose = true, description = 'Adds alerts for the online owner. Use it next to the parked car.' },
{ name = 'alarm_module_dispatch', label = 'Dispatch Alarm Module', weight = 200, type = 'item', image = 'alarm_module_dispatch.png', unique = true, useable = false, shouldClose = true, description = 'Adds owner alerts and police dispatch. Use it next to the parked car.' },
{ name = 'ignition_cutoff_relay', label = 'Ignition Cut-off Relay', weight = 250, type = 'item', image = 'ignition_cutoff_relay.png', unique = true, useable = false, shouldClose = true, description = 'Blocks hotwiring. A valid key is required to start the engine. Fit at hood markers.' },
{ name = 'keypad_cutoff_module', label = 'Keypad Cut-off Module', weight = 250, type = 'item', image = 'keypad_cutoff_module.png', unique = true, useable = false, shouldClose = true, description = 'Blocks hotwiring and asks for a four-digit PIN at every engine start. Turns remote start off.' },
{ name = 'gps_signal_jammer', label = 'GPS Signal Jammer', weight = 200, type = 'item', image = 'gps_signal_jammer.png', unique = false, useable = false, shouldClose = true, description = 'Temporarily blocks police GPS tracking and wireless alarm alerts.' },
{ name = 'tracker_extraction_kit', label = 'Tracker Extraction Kit', weight = 200, type = 'item', image = 'tracker_extraction_kit.png', unique = false, useable = false, shouldClose = true, description = 'Removes an installed police GPS module.' },