Company Manager
Dependencies
- oxmysql (opens in a new tab) (recommended) or mysql-async (opens in a new tab)
- ox_lib (opens in a new tab)
- ESX or QB-Core Framework
Optional Requirements
Installation
Import SQL
For ESX Framework: Import bcs_companymanager.sql
to your database
For QBCore Framework: Import [QB]bcs_companymanager.sql
to your database
Add the Script
Place the script in your resources folder
Configure Server.cfg
Ensure/start the script in your server.cfg. Make sure it loads after ox_lib and your framework (ESX/QB-Core):
ensure bcs_companymanager
For es_extended 1.1 and 1.2
Add the following code to 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
Keybind for Billing Menu (Optional)
To enable opening the billing menu with a keybind, uncomment and modify this section:
bcs_companymanager/client/functions.lua
RegisterKeyMapping(Config.BillCommand, 'Open bill menu', 'keyboard', 'F7')
-- Change 'F7' to your preferred key
Adding New Companies/Jobs
To add a new company or job, you'll need to update three configuration files:
1. Update Billing Configuration
Add the job in config/billing.lua
:
config/billing.lua
jobname = {
company_grade = 4, -- Minimum grade required for Company Menu access
min_grade = 2, -- Minimum grade required for creating bills
cancel_bill = 4, -- Minimum grade required to cancel a bill
employeecut = 0, -- Percentage of bill payment that goes to the employee (0 means all money goes to company)
},
2. Update Boss Menu Configuration
Add the job in config/bossmenu.lua
:
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 in this job
-- 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
}
}
3. Update Black Money Configuration
Add the job in config/config.lua
in the EnableBlackMoney section:
config/config.lua
EnableBlackMoney = {
mechanic = true, -- Enable or disable company's ability to keep black money
ambulance = false,
police = false,
jobname = true, -- Add your new job here with appropriate setting
}
Mugshot Integration
ESX Framework (DEPRECATED)
- Import
optional.sql
if your users table does not have a mugshot column - Add this code to your
es_extended/server/classes/player.lua
after theself.setName
function:
self.getMugshot = function()
return self.mugshot
end
self.setMugshot = function(mugshot)
self.mugshot = mugshot
end
- Enable mugshots in
config.lua
:
Config.mugshot = true
QBCore Framework
- Add this metadata to save the mugshot in
qb-core/server/player.lua
:
PlayerData.metadata['mugshot'] = PlayerData.metadata['mugshot'] or ''
- Enable mugshots in
config.lua
:
Config.mugshot = true
Last updated on