Exports
Server exports and client hooks of Yecoyz Boss Menu.
Get yecoyz_bossmenuServer exports
| Export | Arguments | Returns | Description |
|---|---|---|---|
OpenBossMenu |
source |
true or false |
Opens the menu where the player stands, over the whole screen. false when the player has no access |
GetAccess |
source |
Table or nil |
What the player can do in the boss menu |
lua
-- server: open the boss menu from your own job menu
exports.yecoyz_bossmenu:OpenBossMenu(source)
-- server: check access
local access = exports.yecoyz_bossmenu:GetAccess(source)
if access and access.perms.hire then
-- this player may hire
endGetAccess returns { job, jobLabel, grade, gradeLabel, isBoss, identifier, name, perms = { hire = true, ... } }, or nil when the player has no access. The permission names are listed on the Access page.
Client hooks
client/open.lua is meant to be edited for your server:
| Hook | When |
|---|---|
BM.OnVehicleSpawned(vehicle, plate, model) |
A bought vehicle was spawned at the computer. Give keys and fuel here |
BM.OnMenuOpen() |
The menu opened. Hide your HUD here, for example |
BM.OnMenuClose() |
The menu closed |
lua
function BM.OnMenuOpen()
exports['my-hud']:Hide(true)
end
function BM.OnMenuClose()
exports['my-hud']:Hide(false)
endTranslations
Every text is in locales/en.json. Copy it to a new file, for example sv.json, translate it and set Config.Locale = 'sv'.