For the complete documentation index, see llms.txt. This page is also available as Markdown.

🚚Delivery

The delivery system is what gives the player their vehicle, weapon, skin, money or pack once a checkout is completed. It supports three layered customization mechanisms, from simplest to most flexible.

Mechanism 1 — Weapon delivery mode

In shared/config.lua:

Delivery = {
  WeaponDeliveryMode = "native", -- "native" or "item"
}
Mode
Behavior

"native"

Uses xPlayer.addWeapon (ESX) or the QBCore native — the player gets the weapon directly.

"item"

Gives the weapon as an inventory item (ox_inventory, qs-inventory, qb-inventory…). The IDs in Products.Weapons must match item names that exist in your inventory.

Hooks are the cleanest way to plug your own garage / inventory / money system without touching encrypted files. Edit server/framework/hooks.lua:

VarShop = VarShop or {}
VarShop.FrameworkOverrides = VarShop.FrameworkOverrides or {}

-- Vehicle delivery to your own garage table
function VarShop.FrameworkOverrides.giveVehicle(src, identifier, item)
  -- item = { id = "rebla", kind = "vehicle", qty = 1, meta = { upgrades = {...}, plate = "..." } }
  local plate = item.meta and item.meta.plate or ("VAR" .. math.random(10000, 99999))

  MySQL.insert.await([[
    INSERT INTO my_garage_table (citizenid, model, plate, garage)
    VALUES (?, ?, ?, ?)
  ]], { identifier, item.id, plate, "pillboxgarage" })

  return true -- true = handled, do not run default ESX/QB logic
end

-- Force a specific inventory for weapons
function VarShop.FrameworkOverrides.giveWeapon(src, identifier, item)
  exports['ox_inventory']:AddItem(src, item.id, item.qty or 1)
  return true
end

-- Items / skins
function VarShop.FrameworkOverrides.giveItem(src, identifier, item)
  exports['ox_inventory']:AddItem(src, item.id, item.qty or 1, item.meta)
  return true
end

Return true to signal "I handled this delivery myself". Return nil (or nothing) to fall back to the default ESX/QB logic.

Mechanism 3 — Handlers config

If you prefer routing specific kinds to events or exports without writing hook code:

Available handler keys

Key
Effect

Type = "framework:vehicle"

Inserts into ESX owned_vehicles or QB player_vehicles

Type = "framework:weapon"

Native addWeapon (mode native) or addInventoryItem (mode item)

Type = "framework:item"

Native addInventoryItem of your framework

Type = "framework:money"

Native addMoney of your framework

Type = "framework:pack"

Unpacks contents = { { kind = "vehicle", ref = "rebla" }, … }

Event = "..."

TriggerEvent(event, src, identifier, item)

Export = "resource:func"

exports[resource][func](src, identifier, item)

Garage table mapping

If your server doesn't follow the standard ESX (owned_vehicles) or QB (player_vehicles) schema, remap the columns in shared/config.lua:

Item shape received by handlers

Last updated