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.
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.
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_coverslists the vehicles that are waiting under a hand-over cover. - The server exports
photosList,photosSaveandphotosDeletestore 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.
| What | Resources | Where |
|---|---|---|
| Vehicle keys | zyke_vehiclekeys, qbx_vehiclekeys, qb-vehiclekeys, wasabi_carlock | Framework:GiveKeys in frameworks/<framework>/client.lua |
| Fuel | ox_fuel, LegacyFuel, cdn-fuel, ps-fuel | Framework:SetFuel in frameworks/<framework>/client.lua |
| Company accounts | QBCore: Renewed-Banking, qb-banking, qb-management. Qbox: Renewed-Banking, qb-banking, qbx_management, qb-management. ESX: esx_addonaccount, jobs only | Framework:SocietyBalance, SocietyRemove and SocietyAdd in frameworks/<framework>/server.lua |
| Owned vehicles | The player_vehicles table on QBCore and Qbox, owned_vehicles on ESX | Framework:InsertVehicle, OwnedVehicles, VehicleByPlate, DeleteVehicle, SetVehicleOwner and SaveVehicleProps in frameworks/<framework>/server.lua |
| Money | The player’s framework accounts | Framework:GetMoney, AddMoney and RemoveMoney in frameworks/<framework>/server.lua |
| Notifications | The notification of your framework | Framework:Notify in both files of frameworks/<framework> |
| Server admins | Framework permissions and the ACE command | Framework:IsAdmin in frameworks/<framework>/server.lua |
| Vehicle list for the import | The shared vehicle list on QBCore and Qbox, the vehicles table on ESX | Framework:VehicleSource in frameworks/<framework>/server.lua |
| Inventory | ox_inventory, qb-inventory, ps-inventory, core_inventory, codem-inventory, origen_inventory, tgiann-inventory and the ESX default inventory | One file each in src/inventories |
| Target | ox_target, qb-target | src/interactions/ox_target.lua and src/interactions/qb-target.lua |
| Prompts | The ox_lib text UI, or GTA’s help text | src/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.
| What | Resources | Setting |
|---|---|---|
| Inventory, target and prompts | The ones in the table above | Config.Inventory, Config.Target and Config.Interaction, see Inventory and Target and prompts |
| Mileage | bablo-hud, jg-vehiclemileage or your framework | Config.Mileage.Source, see Mileage |
| Bank loans | bablo-banking | Config.Finance.Bank, see Bank loans |
| Company accounts | bablo-banking | No setting. While bablo-banking runs with its society accounts on, company purchases use those accounts and the framework bridge is not asked. |
| Vehicle pictures | Fivemanage | The bablo_dealerships_fivemanage_key convar in server.cfg, see Photo Studio |

