Wasabi Scripts
StoreDiscordGitHub
  • Documentation
  • Dependency
    • 🔗wasabi_bridge
      • Dependencies
      • Installation
      • Configuration
      • Custom Notifications
      • Common Issues & Fixes
  • Advanced Series
    • 🚑wasabi_ambulance
      • Dependencies
      • Installation
      • Configuration
      • Death Screens
      • Exports / Events
      • State Bags
      • Customizations
      • Common Issues
        • QBCore
    • 🩺wasabi_crutch
      • Dependencies
      • Installation
      • Configuration
      • Exports
    • 👮‍♂️wasabi_police
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • State Bags
      • Events
      • Customizations
    • 🔎wasabi_evidence
      • Dependencies
      • Installation
      • Configuration
      • Customizations
    • 🛡️wasabi_adminmenu
      • Dependencies
      • Installation
      • Configuration
    • 👷wasabi_multijob
      • Dependencies
      • Installation
      • Configuration
      • Replace ESX Boss Menus
    • 🔑wasabi_carlock
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Common Issues
        • QBCore
  • Core UI Series
    • 🖥️wasabi_loadingscreen
      • Configuration
    • 🧑‍🤝‍🧑wasabi_multichar
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Events
    • 💳wasabi_banking
      • Dependencies
      • Installation
      • Configuration
      • Exports
    • 👼wasabi_spawn
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • Events
    • 🔔wasabi_notify
      • Exports / Events
      • Configuration
      • Change Framework Notify
    • ⏸️wasabi_pausemenu
      • Dependencies
      • Installation
      • Configuration
      • Exports
  • Heist Series
    • 🏦wasabi_pacificrobbery
      • Dependencies
      • Installation
      • Configuration
      • Events
    • 🏦wasabi_paletorobbery
      • Dependencies
      • Installation
      • Configuration
      • Events
    • 🏦wasabi_fleecarobberies
      • Dependencies
      • Installation
      • Configuration
      • Events
  • 💎wasabi_vangelicorobbery
    • Dependencies
    • Installation
    • Configuration
    • Events
  • 🔫wasabi_ammunationrobbery
    • Dependencies
    • Installation
    • Configuration
    • Events
  • 🚢wasabi_yachtheist
    • Dependencies
    • Installation
    • Configuration
    • Events
  • Free Releases
    • 👕fivem-appearance
      • Installation
      • Dependencies
      • Common Issues
      • Snippets
      • Exports
      • Examples
    • 👩‍💻wasabi_discord
      • Installation
      • Exports
Powered by GitBook
On this page
  1. Advanced Series
  2. wasabi_multijob

Replace ESX Boss Menus

Small guide to easily replace stock esx_society boss menus with wasabi_multijob's boss menu


  • Open esx_society/client/main.lua

Find this code:OpenBossMenu
function (society, close, options)
	options = options or {}
	local elements = {}
 
	ESX.TriggerServerCallback('esx_society:isBoss', function(isBoss)
		if isBoss then
			local defaultOptions = {
				withdraw = true,
				deposit = true,
				wash = true,
				employees = true,
				grades = true
			}
 
			for k,v in pairs(defaultOptions) do
				if options[k] == nil then
					options[k] = v
				end
			end
 
			if options.withdraw then
				table.insert(elements, {label = _U('withdraw_society_money'), value = 'withdraw_society_money'})
			end
 
			if options.deposit then
				table.insert(elements, {label = _U('deposit_society_money'), value = 'deposit_money'})
			end
 
			if options.wash then
				table.insert(elements, {label = _U('wash_money'), value = 'wash_money'})
			end
 
			if options.employees then
				table.insert(elements, {label = _U('employee_management'), value = 'manage_employees'})
			end
 
			if options.grades then
				table.insert(elements, {label = _U('salary_management'), value = 'manage_grades'})
			end
 
			ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boss_actions_' .. society, {
				title    = _U('boss_menu'),
				align    = 'top-left',
				elements = elements
			}, function(data, menu)
				if data.current.value == 'withdraw_society_money' then
					ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'withdraw_society_money_amount_' .. society, {
						title = _U('withdraw_amount')
					}, function(data2, menu2)
						local amount = tonumber(data2.value)
 
						if amount == nil then
							ESX.ShowNotification(_U('invalid_amount'))
						else
							menu2.close()
							TriggerServerEvent('esx_society:withdrawMoney', society, amount)
						end
					end, function(data2, menu2)
						menu2.close()
					end)
				elseif data.current.value == 'deposit_money' then
					ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'deposit_money_amount_' .. society, {
						title = _U('deposit_amount')
					}, function(data2, menu2)
						local amount = tonumber(data2.value)
 
						if amount == nil then
							ESX.ShowNotification(_U('invalid_amount'))
						else
							menu2.close()
							TriggerServerEvent('esx_society:depositMoney', society, amount)
						end
					end, function(data2, menu2)
						menu2.close()
					end)
				elseif data.current.value == 'wash_money' then
					ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'wash_money_amount_' .. society, {
						title = _U('wash_money_amount')
					}, function(data2, menu2)
						local amount = tonumber(data2.value)
 
						if amount == nil then
							ESX.ShowNotification(_U('invalid_amount'))
						else
							menu2.close()
							TriggerServerEvent('esx_society:washMoney', society, amount)
						end
					end, function(data2, menu2)
						menu2.close()
					end)
				elseif data.current.value == 'manage_employees' then
					OpenManageEmployeesMenu(society)
				elseif data.current.value == 'manage_grades' then
					OpenManageGradesMenu(society)
				end
			end, function(data, menu)
				if close then
					close(data, menu)
				end
			end)
		end
	end, society)
end 
Replace with this code:
function OpenBossMenu(society, close, options)
	exports.wasabi_multijob:openBossMenu(society)
end
PreviousConfigurationNextwasabi_carlock

Last updated 1 year ago

👷