CS Docs
Discord
  • Welcome
  • Paid Scripts
    • CS MULTIJOB
      • Installation
      • Configuration
      • Exports
Powered by GitBook
On this page
  • Follow this guide to integrate the script with your framework
  • ESX
  • QBCore
  1. Paid Scripts
  2. CS MULTIJOB

Installation

Here you'll learn how to install my amazing script in your FiveM server.

PreviousCS MULTIJOBNextConfiguration

Last updated 26 days ago

  1. Head to, find cs_multijob and download it.

  2. Open the downloaded file and drag the folder into the desired folder in your server's resource folder.

  3. Rename the dragged folter to cs_multijob.

  4. Check the config and adjust it to your needs. If you turn off 'Config.autoSQL' then you'll need to run database.sql manually.

Follow this guide to integrate the script with your framework

You must do this to call our script when a player is dismissed using the boss menu to successfully delete a player job; otherwise, the player will keep the job.

ESX

  1. Go to esx_society and open server/main.lua.

  2. Do ctrl + f and search for:

 ESX.RegisterServerCallback('esx_society:setJob',
  1. Replace the whole function with this:

ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier, job, grade, actionType)
	local xPlayer = ESX.GetPlayerFromId(source)
	local isBoss = Config.BossGrades[xPlayer.job.grade_name]
	local xTarget = ESX.GetPlayerFromIdentifier(identifier)

	if not isBoss then
		print(('[^3WARNING^7] Player ^5%s^7 attempted to setJob for Player ^5%s^7!'):format(source, xTarget.source))
		return cb()
	end

	if not xTarget then
		MySQL.update('UPDATE users SET job = ?, job_grade = ? WHERE identifier = ?', {job, grade, identifier},
		function()
			cb()
		end)
		return
	end

	xTarget.setJob(job, grade)
	
	if actionType == 'hire' then
		xTarget.showNotification(TranslateCap('you_have_been_hired', job))
		xPlayer.showNotification(TranslateCap("you_have_hired", xTarget.getName()))
	elseif actionType == 'promote' then
		xTarget.showNotification(TranslateCap('you_have_been_promoted'))
		xPlayer.showNotification(TranslateCap("you_have_promoted", xTarget.getName(), xTarget.getJob().grade_label))
	elseif actionType == 'fire' then
		xTarget.showNotification(TranslateCap('you_have_been_fired', xTarget.getJob().label))
		xPlayer.showNotification(TranslateCap("you_have_fired", xTarget.getName()))

		local targetSrc = xTarget.source
		exports.cs_multijob:removeJob(targetSrc, xTarget.job.name)
	end

	cb()
end)

QBCore

  1. Go to qb-management and open server/sv_boss.lua.

  2. Do ctrl + f and search for:

    RegisterNetEvent('qb-bossmenu:server:FireEmployee',
  3. Replace the whole function with this:

RegisterNetEvent('qb-bossmenu:server:FireEmployee', function(target)
	local src = source
	local Player = QBCore.Functions.GetPlayer(src)
	local Employee = QBCore.Functions.GetPlayerByCitizenId(target) or QBCore.Functions.GetOfflinePlayerByCitizenId(target)

	if not Player.PlayerData.job.isboss then
		ExploitBan(src, 'FireEmployee Exploiting')
		return
	end

	if Employee then
		if target == Player.PlayerData.citizenid then
			TriggerClientEvent('QBCore:Notify', src, 'You can\'t fire yourself', 'error')
			return
		elseif Employee.PlayerData.job.grade.level > Player.PlayerData.job.grade.level then
			TriggerClientEvent('QBCore:Notify', src, 'You cannot fire this citizen!', 'error')
			return
		end
		if Employee.Functions.SetJob('unemployed', '0') then
			Employee.Functions.Save()
			TriggerClientEvent('QBCore:Notify', src, 'Employee fired!', 'success')
			exports["cs_multijob"]:removeJob(Employee.PlayerData.source, Employee.PlayerData.job.name)
			TriggerEvent('qb-log:server:CreateLog', 'bossmenu', 'Job Fire', 'red', Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' successfully fired ' .. Employee.PlayerData.charinfo.firstname .. ' ' .. Employee.PlayerData.charinfo.lastname .. ' (' .. Player.PlayerData.job.name .. ')', false)

			if Employee.PlayerData.source then -- Player is online
				TriggerClientEvent('QBCore:Notify', Employee.PlayerData.source, 'You have been fired! Good luck.', 'error')
			end
		else
			TriggerClientEvent('QBCore:Notify', src, 'Error..', 'error')
		end
	end
	TriggerClientEvent('qb-bossmenu:client:OpenMenu', src)
end)

That's all. Head to the Configuration section if you want to know how to configure it!

https://keymaster.fivem.net/asset-grants