Skip to content

Ot Glovebox Lock

by The Desh Node.js Roleplay

FiveM PIN-protected vehicle glovebox system with a usable Glovebox Lock Kit for ox_inventory, Qbox and QBCore.

README.md

Overtime RP Glovebox Lock v1.2.0

PIN-protected vehicle gloveboxes for FiveM using ox_inventory, ox_lib, oxmysql, and Qbox/QBCore ownership checks.

Inventory Item

Players now use a physical Glovebox Lock Kit inventory item to manage the system.

Using the item beside or inside a vehicle opens a menu with:

  • Install Glovebox PIN
  • Change Glovebox PIN
  • Remove Glovebox PIN
  • View Security Status

The server verifies that the player actually possesses the item before any PIN can be installed, changed, or removed.

Installation

  1. Put ot_glovebox_lock in your resources folder.
  2. Run install.sql in your database.
  3. Add the item from ox_inventory_item.lua to ox_inventory/data/items.lua.
  4. Copy glovebox_lockkit.png into ox_inventory/web/images/.
  5. Set your framework in config.lua:
Lua
Config.Framework = 'qbox' -- Qbox
-- or
Config.Framework = 'qb'   -- QBCore
  1. Confirm your vehicle ownership table settings in config.lua.
  2. Start the resource after ox_inventory:
CFG
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ot_glovebox_lock

For QBCore, use ensure qb-core instead of qbx_core.

ox_inventory item

Add this inside ox_inventory/data/items.lua:

Lua
['glovebox_lockkit'] = {
    label = 'Glovebox Lock Kit',
    weight = 250,
    stack = false,
    close = true,
    consume = 0,
    description = 'Electronic security device used to install or manage a PIN lock on a vehicle glovebox.',
    client = {
        image = 'glovebox_lockkit.png',
        export = 'ot_glovebox_lock.useLockKit'
    }
},

The included glovebox_lockkit.png is the exact custom Glove Box Lock artwork supplied for Overtime RP.

Giving the item

Use whatever admin/shop/crafting system your server already uses to give the item named:

glovebox_lockkit

The item is reusable by default.

To make each kit install only one NEW lock, change:

Lua
Config.ReusableManagementItem = false

The server will then remove one kit when a previously-unlocked glovebox receives its first PIN. Changing/removing an existing PIN does not consume another kit.

Commands

Commands are disabled by default because the inventory item is intended to be the normal interface:

Lua
Config.EnableCommands = false

For testing/admin use you can set it to true. Even then, if Config.RequireManagementItem = true, the server still requires the player to possess the kit.

PIN access

A locked glovebox still works normally from the player's perspective: they try to open the glovebox and receive a PIN prompt. Correct entry opens the real ox_inventory glovebox.

The management item is only required to install/change/remove the lock; it is not required simply to enter a PIN on a locked glovebox.

Security

  • PIN verification is server-side.
  • PINs are stored as salted hashes, not plain text.
  • Vehicle ownership is checked server-side.
  • Possession of the management item is checked server-side.
  • Repeated wrong PIN attempts trigger a configurable lockout.
  • The inventory ID and vehicle plate are cross-checked before opening.