All resources

rsg-bossmenu – Docs (v3.0.1)#

Contents#

  1. Files
  2. How it works
  3. Configuration
  4. Exports and events
  5. Database
  6. Security
  7. Server owner how-tos
  8. Troubleshooting

1. Files#

FilePurpose
fxmanifest.luaManifest; depends on rsg-core, oxmysql, rsg-inventory; exports AddMoney, RemoveMoney, GetAccount
config.luaBoss locations, keybind, limits
client/client.luaPrompts, blips, NUI bridge
server/server.luaEmployees, hire/fire/grade, stash, society account
server/versionchecker.luaGitHub version check
html/NUI (index.html, style.css, script.js)
locales/*.jsonen, cs, de, el, es, fr, hu, it, pl, pt-br

2. How it works#

  • A boss stands at one of the Config.BossLocations and presses Config.Keybind (default J) to open the menu.
  • Employee list (online and offline), promote/demote, fire (online or offline), hire nearby players.
  • Shared boss stash through rsg-inventory, named boss_<job>.
  • Society bank in the management_funds table (type boss), shared with rsg-gangmenu's table.
  • The player's job grade must have isboss = true.

3. Configuration#

config.lua:

OptionDefaultMeaning
BliptableBlip name, sprite, scale
Keybind'J'Open key
StorageMaxWeight4000000Stash weight
StorageMaxSlots50Stash slots
InteractDistance5.0Server-side max distance from a boss location
HireDistance10.0Max distance to a player you can hire
MaxTransaction1000000Max single deposit/withdraw
BossLocationslist{ id, name, coords, showblip, job }; job must match the job name
{ id = 'sheriff_boss', name = 'Law Boss Menu', coords = vector3(0, 0, 0), showblip = false, job = 'vallaw' },

4. Exports and events#

NameSideNotes
GetAccount(account)server exportBalance of a job account
AddMoney(account, amount)server exportReturns true/false; amount is floored and must be > 0
RemoveMoney(account, amount)server exportFalse if the balance is too low
rsg-bossmenu:client:mainmenuclient eventOpen the menu
rsg-bossmenu:server:openinventoryserver eventOpen the boss stash
rsg-bossmenu:server:withdrawMoney / depositMoneyserver events(amount)
rsg-bossmenu:server:GetAccountcallbackBalance for the player's job
rsg-bossmenu:server:GetEmployeescallbackEmployee list
rsg-bossmenu:server:GradeUpdateserver event(data) promote/demote
rsg-bossmenu:server:FireEmployeeserver event(target)
rsg-bossmenu:server:HireEmployeeserver event(recruit)
rsg-bossmenu:server:GetNearbyPlayerscallbackHire candidates
exports['rsg-bossmenu']:AddMoney('vallaw', 500)

5. Database#

Uses the management_funds table (job_name, amount, type), created by the rsg-core SQL. This resource only writes rows with type = 'boss'.

6. Security#

Every action re-checks the real job and boss status on the server. The stash name and job are never taken from the client. Stash and money need proximity to a configured boss location. Amounts are sanitised and capped, and actions have cooldowns. Hiring re-checks distance. Actions are logged through rsg-log.

7. How-tos#

  • New job menu: add a BossLocations entry; the job must exist in your jobs data and its boss grade needs isboss = true.
  • Pay a society from another script: exports['rsg-bossmenu']:AddMoney(job, amount).
  • Language: setr rsg:locale "de" in server.cfg.

8. Troubleshooting#

ProblemFix
No prompt at the locationPlayer's job must match job, and the grade must be boss
Money won't loadCheck the management_funds table exists
Can't hireTarget must be within HireDistance

Support the Project : https://rexshack.tebex.store/

<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-bossmenu 3.0.1. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core, oxmysql, rsg-inventory

Configuration#

OptionDefaultNotes
Config.Bliptableblip settings
Config.Keybind'J'settings
Config.StorageMaxWeight4000000
Config.StorageMaxSlots50
Config.InteractDistance5.0max distance from a boss location for server actions
Config.HireDistance10.0max distance to a player you can hire
Config.MaxTransaction1000000max single deposit/withdraw
Config.BossLocationstable

Callbacks#

CallbackSideArgumentsFile
rsg-bossmenu:server:GetAccountserversource, cbserver/server.lua
rsg-bossmenu:server:GetEmployeesserversource, cbserver/server.lua
rsg-bossmenu:server:GetNearbyPlayersserversource, cbserver/server.lua
-- client side
RSGCore.Functions.TriggerCallback('rsg-bossmenu:server:GetAccount', function(result)
    -- use result
end)

Events#

Server events can be fired by any client, so every handler re-validates the player, the arguments and any permission, distance or cooldown on the server. Never add a reward to a handler without those checks.

EventSideArgumentsFile
RSGCore:Client:OnPlayerLoadedclient``client/client.lua
RSGCore:Client:OnPlayerUnloadclient``client/client.lua
RSGCore:Client:OnJobUpdateclientJobInfoclient/client.lua
rsg-bossmenu:client:mainmenuclient``client/client.lua
rsg-bossmenu:server:openinventoryserver``server/server.lua
rsg-bossmenu:server:withdrawMoneyserveramountserver/server.lua
rsg-bossmenu:server:depositMoneyserveramountserver/server.lua
rsg-bossmenu:server:GradeUpdateserverdataserver/server.lua
rsg-bossmenu:server:FireEmployeeservertargetserver/server.lua
rsg-bossmenu:server:HireEmployeeserverrecruitserver/server.lua
-- from a client script
TriggerServerEvent('rsg-bossmenu:server:openinventory')
-- from a server script
TriggerClientEvent('RSGCore:Client:OnPlayerLoaded', source)

Locales#

Language files in locales/: cs, de, el, en, es, fr, hu, it, ja, nl, pl, pt-br, ro, ru. Set the language with setr rsg:locale "en".

<!-- END AUTO-REFERENCE -->