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.
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.
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.
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!
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.
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
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?