Exports
Eleven Comercios exports and events for other FiveM resources: businesses, fleet and fines, applications, maintenance, delivery, wholesale, robberies and taxis.
Exports you can call from your own resources. Each one runs on the side shown (server or client) and needs no edits to use.
Businesses and fleet (server)
Resource: eleven-comercios.
| Export | Returns | What for |
|---|---|---|
getBusinessList() | { { business_key, label, logo_url }, … } | List of registered businesses. |
GetFleetBusiness(plate) | { key, label } or nil | The business that owns a plate, or nil if it isn't a fleet vehicle. |
ChargeFleetFine(data) | table | Charges a traffic fine to the company that owns the vehicle. |
GetMaxEmployeesForLevel(level) | number | Staff cap for an internal level. |
GetMaxCrafteoSlotsForLevel(level) | number | Crafting point cap for an internal level. |
GetLevelMetricCatalog() | list | Metrics available for level rules (key, label, unit, icon, boolean). |
ChargeFleetFine
Meant for speed cameras or fine systems. If the plate belongs to a business fleet, the fine is charged to its account and logged in its history; if not, it returns handled = false and your resource carries on with its usual fine for the driver.
local res = exports['eleven-comercios']:ChargeFleetFine({
plate = 'ABC 123',
amount = 500,
article = 'Speeding', -- optional
issuer = 'Speed camera', -- optional
kind = 'radar', -- optional
model = 'Speedo', -- optional
location = 'Vinewood Blvd', -- optional
driverCitizenId = 'ABC12345', -- optional
driverName = 'First Last', -- optional
})
if res.handled then
-- res.paid: true if charged, false if left pending for lack of funds
-- res.businessKey, res.businessLabel, res.fineId, res.amount
else
-- not a fleet vehicle: fine the driver as usual
end
Note
The money goes to the account of the job set in Config.FleetFines.Payee (police by default), through eleven-banking if it's running or Renewed-Banking otherwise. See Business config.lua.
Job applications (server)
| Export | Returns | What for |
|---|---|---|
AddApplication(jobName, data) | id or nil | Adds an application to the business's Applications tab. |
Use it to connect your own job board, website or bot. Answers follow the form the business has set up on the tablet. Hiring is then done by hand from Employees.
local id = exports['eleven-comercios']:AddApplication('burgershot', {
citizenid = 'ABC12345', -- required
name = 'First Last',
phone = '5550123',
listingId = 1, -- optional: your listing id
listingTitle = 'Cook', -- optional
answers = { ... }, -- answers to the form
})
Set Config.Integrations.Applications = true in config.lua once something is sending applications.
Maintenance (server)
| Export | Returns | What for |
|---|---|---|
isJobBlackout(jobName) | boolean | Whether the business is currently in a blackout. |
getCleanlinessFactor(jobName) | number between the floor and 1.0 | Cleanliness factor applied to NPC prices. |
getNodeCondition(nodeId) | number | Current condition (0–100) of a node. |
reloadMaintenance() | — | Reloads nodes and perimeters from the database. |
Maintenance (client)
| Export | Returns | What for |
|---|---|---|
getBlackoutJob() | job or nil | The blacked-out business whose perimeter contains the player right now. |
getMaintenanceZones() | table | Blackout perimeters per business. |
getMaintenanceNodes() | table | Loaded maintenance nodes. |
getNodeConditionLocal(nodeId) | number | A node's condition as computed on the client. |
Delivery points (server)
To manage the delivery zones from another resource, for example a staff panel.
| Export | Returns | What for |
|---|---|---|
GetDeliveryPoints() | list | Every zone with id, label, x, y, z, enabled, validated… |
CreateDeliveryPoint(data, createdBy) | id or nil | Creates a zone. data = { label, x, y, z, enabled }. |
UpdateDeliveryPoint(id, data) | boolean | Changes a zone. Moving it marks it as unchecked again. |
DeleteDeliveryPoint(id) | boolean | Deletes a zone. |
ResetDeliveryPoint(id) | boolean | Clears its reports and re-enables it. |
local id = exports['eleven-comercios']:CreateDeliveryPoint({
label = 'Legion Square',
x = -274.3, y = -959.4, z = 31.2,
}, 'admin')
Food truck (server)
| Export | Returns | What for |
|---|---|---|
IsNearFoodTruckKitchen(source, jobName, slot) | boolean | Whether the player is at the kitchen of a deployed food truck of that business. |
Crafting (client)
Resource: eleven-comercios-admin.
| Export | Returns | What for |
|---|---|---|
OpenCraftingMenu(jobName, slot) | — | Opens the oven of a crafting point. |
IsCrafting() | boolean | Whether the player is in the crafting interface. |
IsUIOpen() | boolean | Whether the admin panel is open. |
Wholesale (server)
Resource: eleven-comercios-admin.
| Export | Returns | What for |
|---|---|---|
JobHasWholesale(jobName) | boolean | Whether the business works with any wholesaler. |
GetJobWholesaleCatalog(jobName) | table | The catalog that business sees. |
GetJobWholesaleOrders(jobName, limit) | list | The business's latest orders. |
GetWholesalePickupPoints(jobName) | list | Pick-up points (empty if it has no wholesaler). |
Wholesale orders can only be created from the tablet.
Web integration (server)
They only make sense with Config.Integrations.Web = true (see Business config.lua).
| Export | Returns | What for |
|---|---|---|
ComercioCerrado(jobName) | boolean | Whether the business is closed because its owner lost VIP Business. |
ComercioSinDueno(jobName) | boolean | Whether the business is open to the public because it has no owner. |
Events
Vending machine robbery (server)
Fired every time a business vending machine robbery alert goes off, with or without eleven-police. Use it to send the alert to your dispatch:
AddEventHandler('eleven-comercios:vendingRobberyAlert', function(src, coords, cartId)
-- src: player forcing the machine
-- coords: vector3 of the machine
-- cartId: machine id
end)
Taxi fare (client)
A taximeter can open the tablet's charge screen when a ride ends. It only works if the player has the Config.TaxiJob job and is on duty:
TriggerEvent('pcomercio2:openTaxiOrder', amount, distance)
-- from the server: TriggerClientEvent('pcomercio2:openTaxiOrder', src, amount, distance)