-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job locked licenses #7
base: main
Are you sure you want to change the base?
Conversation
Would it be possible to check in the config it a job lock is defined and only it if it designed to check (might need to do the same for license) |
I don't think I'm understanding what you mean sorry, Currently it works the same way the licenses works where licenses are checking your player metadata on open, the job does the same thing where on open it will check if you have the job and if you job name matches the one defined in the config and if so you see that license |
Something like if Config.job then
if PlayerData.job.name ~= Config.job then
Code to continue the loop without adding the option
end
end |
So just to make sure I understand is Config.Job a table of jobs or a true or false? as I've tried to implement this but I'm really struggling to understand from the example if that is meant to be a table or true or false, and if it's a table I'm not sure how this is different to how it is working currently. Apologies if this is something really obvious/dumb I'm still learning when it comes to fivem and lua |
It is both, sort of. If you make it a string or table and do local job = "police"
if job then
--this code runs, as job is defined
--this wont run if job is false or nil or not defined
--if you put the jobcheck in here it will only run if a job is defined, and you can also have licenses without a job lock / needed license.
end |
Add the ability for Cityhall to check for job roles for licenses to be displayed
Also added comments into the config just for clarification on each part and added commented out job role for weapon license as an example