Skip to content

ZiggyJoJo/just_multijob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just_Multijob



Description

  • All options are adjustable in the config

  • Allows players to have multiple jobs at once

  • The top two ranks can manage employees and rename job grades (Can be disabled in config)

  • Includes shared garages for each business (Can be disabled in config)

  • Includes shared storage for each business (Can be disabled in config)

  • Includes Car dealer, Police, EMS, and Taxi jobs by default but you can easily add more in the config

Dependencies

Config

https://i.imgur.com/zPuQ3JH.png

Usage

Server Side event

        jobs = MySQL.scalar.await('SELECT jobs FROM users WHERE identifier = @identifier', {['@identifier'] = player.identifier})
        jobs = json.decode(jobs)
    end
    for i=1, #jobs, 1 do
        for k, v in pairs(door.groups) do
            if jobs[i].job == k then
                return true
            elseif i == #jobs then
                jobs = MySQL.scalar.await('SELECT jobs FROM users WHERE identifier = @identifier', {['@identifier'] = player.identifier})
                jobs = json.decode(jobs)
            end
        end
    end

Server Side Example

ox_doorlock serveer/framework.lua line 44 add

	if door.groups then
		if #jobs < 1 then
			jobs = MySQL.scalar.await('SELECT jobs FROM users WHERE identifier = @identifier', {['@identifier'] = player.identifier})
			jobs = json.decode(jobs)
		end
		for i=1, #jobs, 1 do
			for k, v in pairs(door.groups) do
				if jobs[i].job == k then
					return true
				elseif i == #jobs then
					jobs = MySQL.scalar.await('SELECT jobs FROM users WHERE identifier = @identifier', {['@identifier'] = player.identifier})
					jobs = json.decode(jobs)
				end
			end
		end
	end

Client Side Callback

passed = lib.callback.await('just_multijob:checkForJob', false, jobname)

Support Me







About

FiveM multijob script for ESX

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages