[Release] [ESX] ESX_JobWhitelisting - Whitelist jobs (and ranks!) to certain players!

Not sure why this hasn’t publicly existed yet, but now it does! Basically this script is a modified version of esx_joblisting. The initial way to whitelist jobs simply kept them from showing up in the Job Center. But now, you can not only allow certain players to see certain jobs, but also have their rank preset in the database to keep people from choosing their own rank. In other words, it effectively eliminates the need for an admin to get online to change someone’s job with /setjob as they previously had to do. It is also compatible with esx_identity, so if a player changes their persona via something like esx_aiomenu, then their new persona will not have access to the same jobs. I hope you find this script useful!
Also - Thanks to Bo | sharky155 again for helping me test it.

Download: GitHub

Demonstration Video: YouTube Video

EDIT (1/8/19): Thanks to @Zabustak for improving the included .sql file. It should now run properly for existing installations of esx_identity. The post on GitHub has been updated to reflect this.

[2/6/2020] I will no longer be providing support for this resource as I do not have an active test environment with ESX and have not used ESX in several months, nor do I intend to ever again.

12 Likes

I mean, if the player is a police officer and changes identities, but not his/her job, they are still a police officer until they change it.

Don’t get me wrong, I love this and trying to figure out why I didn’t think of using the character table. I have something like this, but it’s in the users table.

Now I have to redo mine darn it.

1 Like

I will work on figuring out something to solve that problem and will have an update ready in the days soon to come.

I had to reference the character table because if someone else with a different steam ID makes a character by the same name, they might be able to get an unauthorized job pretty easily. And nobody wants to risk letting that happen - let’s be honest.

Thanks for checking it out and leaving some feedback!

1 Like

We do ours through our CAD and have been considering making it so when they change their character in the cad, it sets their job to unemployed as well. Then they are forced to set their job and if their character isn’t allowed a specific job, they can’t select it.

I showed your video to my CAD dev and we are switching over the character table in the next day or so. Still, GREAT resource for those that don’t have a way to do it themselves.

1 Like

nixce release, people will be happy if they don’t have 2 jobs working !

1 Like

How hard would it be to include other jobs in this such as fire, car dealer, etc…

Other jobs are very easy to implement. Just copy and paste the code and make some more columns in the database. If you’d like me to help you out, I’d be glad to. You can message me on Discord. HaxersAlwaysWin#7078

1 Like

Excellent work still needs to be improved … I modified your database file to be used correctly and without any problems.

USE `essentialmode`;

CREATE TABLE IF NOT EXISTS `characters` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`identifier` VARCHAR(255) NOT NULL,
	`firstname` VARCHAR(255) NOT NULL,
	`lastname` VARCHAR(255) NOT NULL,
	`dateofbirth` VARCHAR(255) NOT NULL,
	`sex` VARCHAR(1) NOT NULL DEFAULT 'M',
	`height` VARCHAR(128) NOT NULL,
	PRIMARY KEY (`id`)
);

ALTER TABLE `characters` ADD COLUMN IF NOT EXISTS (
`ems_rank`  int(11) NULL DEFAULT '-1',
`leo_rank`  int(11) NULL DEFAULT '-1',
`tow_rank`  int(11) NULL DEFAULT '-1'
);

Thank you.The GitHub post has been updated to reflect this

Very awesome thank you! Works great.

1 Like

Hey, Love the idea behind the script, Just having a few issues with it, If you wouldn’t mind, Contact me via discord Hodder#2356

1 Like

Nice Script !! thx.

1 Like

I use ZAP to host my server so I dont have a database. How would I add people to the whitelist?

This script is only compatible with the ESX framework. If you have the ESX framework, you should have a database…

Then I must just be stupid bc my server runs esx. xD

How do I access that database

(keep in mind I use ZAP Hosting if that makes a difference)

I have been told that ZAP uses phpMyAdmin. Feel free to message me on Discord for an instant response HaxersAlwaysWin#7078

1 Like

love you man xD

1 Like

I’ve been looking for a working resource like for some time now!!! I will download and test tonight.

Thank you SO much!!

1 Like

Heres a question… lets say they get promoted at a job using the Job’s boss menu… does the value in the Database automatically update in the character’s table?

2 Likes

When i press E to select a job the Menu of the jobs dont show up, i have no errors.