Bablo ResourcesDocs

Exports & Events

Bablo Dealerships has a small public surface: two exports that return its configuration. There are no exports or events to sell a vehicle, read stock or change a dealership from another resource.

Integration mostly goes the other way. The script calls your keys, fuel, banking, inventory and target resources through open files that you can edit. They are listed under Bridges.


Exports

Both exports work on the server and on the client.

GetConfig

Returns the Config table from config.lua as the script uses it. Settings that were left on auto hold what was detected, for example Framework, Target, Interaction and Inventory.

LUA
local config = exports['bablo-dealerships']:GetConfig()
print(config.AdminCommand, config.Currency.pattern)

The table is a copy. Changing it does not change the script.

GetFramework

Returns the framework the script runs on: 'qbcore', 'qbox' or 'esx'. It returns nil when no framework was found.

LUA
local framework = exports['bablo-dealerships']:GetFramework()

Events and state

The script has no events that other resources are meant to use.

Every bablo-dealerships:* event is internal traffic between the script’s own server and client, and several of them refuse to run when another resource triggers them. Don’t trigger them or rely on them.

Two more things exist only for the script itself:

  • The global state bablo_dealerships_covers lists the vehicles that are waiting under a hand-over cover.
  • The server exports photosList, photosSave and photosDelete store the pictures of the photo studio.

Bridges

These files are not escrowed, so you can change which resource is called. Where a function lists several resources, the first one that is started is used.

WhatResourcesWhere
Vehicle keyszyke_vehiclekeys, qbx_vehiclekeys, qb-vehiclekeys, wasabi_carlockFramework:GiveKeys in frameworks/<framework>/client.lua
Fuelox_fuel, LegacyFuel, cdn-fuel, ps-fuelFramework:SetFuel in frameworks/<framework>/client.lua
Company accountsQBCore: Renewed-Banking, qb-banking, qb-management. Qbox: Renewed-Banking, qb-banking, qbx_management, qb-management. ESX: esx_addonaccount, jobs onlyFramework:SocietyBalance, SocietyRemove and SocietyAdd in frameworks/<framework>/server.lua
Owned vehiclesThe player_vehicles table on QBCore and Qbox, owned_vehicles on ESXFramework:InsertVehicle, OwnedVehicles, VehicleByPlate, DeleteVehicle, SetVehicleOwner and SaveVehicleProps in frameworks/<framework>/server.lua
MoneyThe player’s framework accountsFramework:GetMoney, AddMoney and RemoveMoney in frameworks/<framework>/server.lua
NotificationsThe notification of your frameworkFramework:Notify in both files of frameworks/<framework>
Server adminsFramework permissions and the ACE commandFramework:IsAdmin in frameworks/<framework>/server.lua
Vehicle list for the importThe shared vehicle list on QBCore and Qbox, the vehicles table on ESXFramework:VehicleSource in frameworks/<framework>/server.lua
Inventoryox_inventory, qb-inventory, ps-inventory, core_inventory, codem-inventory, origen_inventory, tgiann-inventory and the ESX default inventoryOne file each in src/inventories
Targetox_target, qb-targetsrc/interactions/ox_target.lua and src/interactions/qb-target.lua
PromptsThe ox_lib text UI, or GTA’s help textsrc/interactions/ox_lib.lua

<framework> is qbcore, qbox or esx. Only the folder of your framework is used.

A bought vehicle, a test drive vehicle and the stock run truck get keys through Framework:GiveKeys and are fuelled to 100 through Framework:SetFuel. When none of the listed key resources runs, no key is given.

To use another resource, add a check for it at the top of the function, before the existing ones. All files you can open are shown in the Script Explorer.

Chosen with a setting

Some integrations are picked with a setting instead of by editing a file. Mileage, bank loans and the picture upload have no open file.

WhatResourcesSetting
Inventory, target and promptsThe ones in the table aboveConfig.Inventory, Config.Target and Config.Interaction, see Inventory and Target and prompts
Mileagebablo-hud, jg-vehiclemileage or your frameworkConfig.Mileage.Source, see Mileage
Bank loansbablo-bankingConfig.Finance.Bank, see Bank loans
Company accountsbablo-bankingNo setting. While bablo-banking runs with its society accounts on, company purchases use those accounts and the framework bridge is not asked.
Vehicle picturesFivemanageThe bablo_dealerships_fivemanage_key convar in server.cfg, see Photo Studio