WhereiamL
whereiaml_vehicleshop

Framework & Bridge

How the resource supports multiple frameworks.

All framework coupling lives in a single file: bridge/framework.lua. The rest of the codebase only calls the Framework table, so adding or swapping a framework means editing one file.

The framework is auto-detected at runtime (qbx_core → QBox, es_extended → ESX).

Bridge API

MethodPurpose
Framework.GetCatalog()Vehicle catalog (QBox); ESX falls back to Config.Catalog.
Framework.GetMoney(src, type)Player cash/bank balance.
Framework.RemoveMoney(src, type, amount, reason)Charge the player.
Framework.AddMoney(src, type, amount, reason)Refund the player.
Framework.GiveVehicle(src, model, props)Create the owned vehicle in the database.
Framework.SpawnOwnedVehicle(src, model, plate, coords, vehicleId, props, typeHint)Spawn it in the world with color/finish and keys.
Framework.SetVehicleOwner(vehicleId, owner)Re-assign or repossess.
Framework.GetCitizenId(src) / GetSrcByCitizenId(id)Identity lookups.
Framework.Notify(...)Framework notification (used when Config.Notifications = 'framework').

ESX notes

  • The catalog must come from Config.Catalog (set Config.CatalogSource = 'config').
  • For non-cars, set vehicleType on the catalog entry ('bike', 'heli', 'boat', …); it defaults to 'automobile'.
  • Vehicle keys are framework-specific; wire your keys system into bridge/framework.lua if needed.

Vehicle delivery uses CreateVehicleServerSetter, a base FiveM native, so the spawn logic is identical and fully server-authoritative on both frameworks.

On this page