Skip to main content

Company Manager

Dependencies

Optional Requirements

Installation

  1. Import SQL bcs_companymanager.sql to your database
  2. Put the script to the resources folder
  3. ensure/start the script in your server cfg ensure bcs_companymanager
  4. For es_extended 1.1 and 1.2 put this in your es_extended/server/functions.lua
es_extended/server/classes/player.lua
ESX.GetExtendedPlayers = function(key, val)
local xPlayers = {}
for _, v in pairs(ESX.Players) do
if key then
if (key == 'job' and v.job.name == val) or v[key] == val or v.variables[key] == val then
xPlayers[#xPlayers+1] = v
end
else
xPlayers[#xPlayers+1] = v
end
end
return xPlayers
end
  1. If you want to open the billing menu using a keybind, you can enable this.
bcs_companymanager/client/functions.lua
    RegisterKeyMapping(Config.billcommand, 'Open bill menu', 'keyboard', 'F7')
-- Change the F7 to the key you want

Adding new companies / jobs

Add the job in the config/billing.lua, config/bossmenu.lua, and config/config.lua in the enableBlack section. These are the templates for new companies:

config/billing.lua
    jobname = {
company_grade = 4, -- Minimum grade for Company Menu access
min_grade = 2, -- Minimum grade for create bill access
cancel_bill = 4, -- Minimum grade to be able to cancel a bill
employeecut = 0, -- in percent. If 0 then every bill payment goes to the company
deposit = 3, -- Minimum grade
withdraw = 4, -- Minimum grade
},
config/bossmenu.lua
    jobname = {
access=3, -- Minimum grade to access the boss menu
hire=3, -- Minimum grade to hire people
fire=4, -- Minimum grade to fire employee
demote=4, -- Minimum grade to demote employee
promote=4, -- Minimum grade to promote employee
setSalary=4, -- Minimum grade to set salary for employees
payCompanyBill=4, -- Minimum grade to pay company bills
},
config/config.lua
    enableBlack={
mechanic = true, -- enable or disable company to keep black money
ambulance = false,
police = false,
jobname = false,
}

Adding mugshots

ESX

  1. Import optional.sql if your users table does not have mugshot column
  2. Add this to your es_extended/server/classes/player.lua after self.setName
es_extended/server/classes/player.lua
    self.getMugshot = function()
return self.mugshot
end

self.setMugshot = function(mugshot)
self.mugshot = mugshot
end
  1. Lastly, enable it in the config.lua Config.mugshot = true

QBCore

  1. Add this metadata to save the mugshot
qb-core/server/player.lua
    PlayerData.metadata['mugshot'] = PlayerData.metadata['mugshot'] or ''
  1. Lastly, enable it in the config.lua Config.mugshot = true