Developers
Bridges
Section titled “Bridges”These files are open so you can adapt sl_trunk to your server:
| File | |
|---|---|
server/bridge/inventory.lua |
Picks the inventory and lists what sl_trunk needs from one |
server/bridge/inventory/qb.lua, ox.lua, qs.lua |
One file per inventory; add your own file with the same functions |
client/bridge/inventory.lua |
Opens the qs-inventory trunk window from the client (set its event prefix here if you changed it) |
shared/framework.lua |
Framework: admin check, job and duty |
client/target.lua |
sl_interact, ox_target, qb-target |
client/notify.lua |
Where notifications go |
To support another inventory, copy qb.lua to a new file, implement the same functions for your inventory (they are listed at the top of server/bridge/inventory.lua) and set Config.Inventory to its name.
Exports and events
Section titled “Exports and events”| Side | ||
|---|---|---|
exports.sl_trunk:AddLootModifier(fn) |
server | fn(ctx, items), see NPC loot |
AddEventHandler('sl_trunk:alert', function(data) end) |
server | A trunk is being forced and an alert is due. data = { source, coords, plate, model, kind } |
AddEventHandler('sl_trunk:alert', function(data) -- data.kind is 'npc' or 'player' exports['my-dispatch']:Send('Vehicle break-in', data.coords, data.plate)end)