Company Manager
Dependencies​
- oxmysql (recommended) / mysql-async
Optional Requirements​
Installation​
- Import SQL
bcs_companymanager.sql
to your database - Put the script to the resources folder
- 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 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
deposit = 3, -- Minimum grade
withdraw = 4, -- Minimum grade
salary=10000000, -- Maximum salary cap that can be set by the boss
job_manager = 4, -- minimum grade to manage permissions & rank
fireSameGrade = true -- Optional -> if true, same grade can be fired
},
config/config.lua
enableBlack={
mechanic = true, -- enable or disable company to keep black money
ambulance = false,
police = false,
jobname = false,
}
Adding mugshots​
ESX​
- Import
optional.sql
if your users table does not have mugshot column - Add this to your
es_extended/server/classes/player.lua
afterself.setName
es_extended/server/classes/player.lua
self.getMugshot = function()
return self.mugshot
end
self.setMugshot = function(mugshot)
self.mugshot = mugshot
end
- Lastly, enable it in the
config.lua
Config.mugshot = true
QBCore​
- Add this metadata to save the mugshot
qb-core/server/player.lua
PlayerData.metadata['mugshot'] = PlayerData.metadata['mugshot'] or ''
- Lastly, enable it in the
config.lua
Config.mugshot = true