legacy-bossmenu
Integration
Exports and events for integrating with legacy-bossmenu from other resources.
Integration
Server exports
OpenBossMenu(src)
Opens the boss menu UI on the target player's client (triggers legacy-bossmenu:openClient).
-- server-side, in any other resource
exports['legacy-bossmenu']:OpenBossMenu(source)
IsBoss(src, jobName)
Returns true if the player is a framework admin, or is currently employed at jobName with a boss-flagged grade.
-- server-side
local isBoss = exports['legacy-bossmenu']:IsBoss(source, 'police')
if isBoss then
-- allow access to a boss-gated feature
end
ListLocations()
Returns the in-memory array of boss-menu zones (id, job, label, icon, coords, radius, createdBy), sorted by id. Backed by data/locations.json, not SQL.
-- server-side
local zones = exports['legacy-bossmenu']:ListLocations()
for _, z in ipairs(zones) do
print(z.id, z.job, z.label, z.coords.x, z.coords.y, z.coords.z, z.radius)
end
Client-side globals (not FiveM exports)
These are plain global functions defined in client/placement.lua, intended to be called from within client/client.lua itself (or copied into your own client script running in this resource's context):
StartBossMenuPlacement(opts, cb)
Starts the in-world raycast placement picker (used by the admin zone editor).
-- client-side (client/client.lua or client/placement.lua)
StartBossMenuPlacement({ radius = 2.0 }, function(result)
-- result is nil if cancelled, or { x, y, z, radius } if confirmed
end)
EndBossMenuPlacement(result)
Ends an active placement session, invoking the pending callback with nil or { x, y, z, radius }.
IsBossMenuPlacementActive()
Returns true while a placement raycast session is active. Useful to suppress your own UI from opening at the same time.
Callbacks (lib.callback)
All of these are server-side lib.callback handlers, callable from the client via lib.callback.await (or exports.ox_lib:callback).
| Name | Payload | Notes |
|---|---|---|
legacy-bossmenu:getInitData |
requestedJob (admins only) |
Full dashboard bootstrap payload. |
legacy-bossmenu:deposit |
{ job, amount, reason } |
Deposits into society account. |
legacy-bossmenu:withdraw |
{ job, amount, reason } |
Requires non-empty reason. |
legacy-bossmenu:hireNearby |
{ job } |
Hires nearest player within 4.0 units. |
legacy-bossmenu:fire |
{ job, citizenid, reason } |
Cannot fire self. |
legacy-bossmenu:promote |
{ job, citizenid } |
Blocked into boss grades unless actor is admin. |
legacy-bossmenu:demote |
{ job, citizenid } |
|
legacy-bossmenu:openStash |
{ job } |
Returns { stashId }. |
legacy-bossmenu:refresh |
{ job } |
Lightweight re-fetch (no branding/series/heatmap). |
legacy-bossmenu:transfer |
{ job, amount, recipient, memo } |
Only works with legacy-banking as the active bridge. |
legacy-bossmenu:listLocations |
— | No authorization check — callable by any client. |
legacy-bossmenu:getJobsForAdmin |
— | Admin-only; returns { name, label }[]. |
legacy-bossmenu:adminCheck |
— | Returns boolean. |
legacy-bossmenu:saveLocation |
{ id?, job, label?, icon?, coords, radius? } |
Admin-only create/update. |
legacy-bossmenu:deleteLocation |
{ id } |
Admin-only delete. |
-- client-side example: fetch dashboard data manually
local data = lib.callback.await('legacy-bossmenu:getInitData', false, nil)
if data then
-- data.job, data.employees, data.revenue30d, data.balance12w, etc.
end
Net events
legacy-bossmenu:dutyHeartbeat (client → server)
Fired every 60 seconds from a client thread while on duty, to keep duty tracking (legacy_bossmenu_hours) alive. No payload.
-- client-side, put in client/client.lua or a resource that manages duty state
TriggerServerEvent('legacy-bossmenu:dutyHeartbeat')
legacy-bossmenu:notify (server → client)
Shows a toast via lib.notify.
-- server-side
TriggerClientEvent('legacy-bossmenu:notify', targetSrc, 'success', 'Welcome to the team!')
legacy-bossmenu:locationsUpdated (server → all clients)
Broadcast whenever the zone list changes. Payload: full array as returned by ListLocations(). Client rebuilds all ox_target zones from this.
legacy-bossmenu:openClient (server → client)
Tells a specific client to open the boss menu UI for a job.
-- server-side
TriggerClientEvent('legacy-bossmenu:openClient', targetSrc, 'police')
Note: the
OpenBossMenuexport as written does not itself pass ajobNameargument — the client resolves the job on its own when handlinglegacy-bossmenu:openClient.