🎉 Driving School is released. Read more →
Paid Scripts
Company Manager v5
Getting Started

Company Manager

Dependencies

Optional Requirements

Installation

Import SQL

Import SQL bcs_companymanager.sql to your database

Put the script

Put the script to the resources folder

ensure/start

ensure/start the script in your server cfg

ensure bcs_companymanager

For es_extended 1.1 and 1.2 put this in your es_extended/server/functions.lua

es_extended/server/functions.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

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
    },
config/bossmenu.lua
    jobname = {
        access = 3, -- Minimum rank required to access the boss menu
 
        -- Billing permissions
        billing = {
            payCompanyBill = 3, -- Minimum rank required to pay company bills
            editPermission = 4, -- Minimum rank required to manage billing permissions
        },
 
        maxSalary = 10000000, -- Maximum salary cap that can be set by the boss
 
        -- Rank management
        rank = { 
            salary = 4, -- Minimum rank required to set employee salaries
            add = 4, -- Minimum rank required to add new ranks
            delete = 4, -- Minimum rank required to delete ranks
            edit = 4, -- Minimum rank required to edit existing ranks
        },
 
        highestRank = 4, -- The highest rank
 
        -- Company permissions
        company = {
            withdraw = 4,  -- Minimum rank required to withdraw company funds
    		fire = 3, -- Minimum rank required to fire employees
    		editPermission = 4,-- Minimum rank required to manage employee permissions
    		demote = 3, -- Minimum rank required to demote employees
    		deposit = 3, -- Minimum rank required to deposit funds into the company account
    		promote = 3, -- Minimum rank required to promote employees
    		hire = 3, -- Minimum rank required to hire new employees
        }
	}
config/config.lua
	EnableBlackMoney = {
        mechanic = true, -- enable or disable company to keep black money
        ambulance = false,
        police = 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
    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
	PlayerData.metadata['mugshot'] = PlayerData.metadata['mugshot'] or ''
  1. Lastly, enable it in the config.lua Config.mugshot = true