Skip to content
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

authorizedGrade #10

Open
TheVirus92 opened this issue Sep 21, 2018 · 7 comments
Open

authorizedGrade #10

TheVirus92 opened this issue Sep 21, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@TheVirus92
Copy link

it's possible add
"authorizedGrade = { 'boss' }," ???

example:
authorizedJobs = { 'police' },
authorizedGrade = { 'boss' },

thanks you :)

@btwentyone
Copy link

Very good idea

@ElPumpo
Copy link

ElPumpo commented Oct 30, 2018

Awful idea, but a step in the right direction. How about seperate grades per job? Jobs obviously don't share the same grade names

@ElPumpo ElPumpo added the enhancement New feature or request label Oct 30, 2018
@oranyero
Copy link

oranyero commented Jun 9, 2019

This is the simple solution:

Edit config.lua and add on all:
authorizedJobs = {{name = 'mafia', grade = 0}},

grade = -1 for all grades of this job.

And in client/main.lua edit the function: function IsAuthorized(doorID)

function IsAuthorized(doorID)
        if ESX.PlayerData.job == nil then
                return false
        end

        for _,job in pairs(doorID.authorizedJobs) do
                if job['name'] == ESX.PlayerData.job.name and  (ESX.PlayerData.job.grade == job['grade'] or job['grade'] == -1)  then
                        return true
                end
        end

        return false
end

Good Job <3

@Prix24
Copy link

Prix24 commented May 5, 2020

I am sure that im doing something wrong but i dont know what because it is not working for me. Can someone help me.

@Gameadictive
Copy link

Gameadictive commented May 28, 2020

I am sure that im doing something wrong but i dont know what because it is not working for me. Can someone help me.

Did you have something like this? https://gyazo.com/c1c2974b660f465b1c3e2af19ab7f044
If yes then change authorizedJobs = { 'police' }, by authorizedJobs = {{name = 'police', grade = 0}},

If this helps let me know

EDIT: Doesn´t work for me too.

Error in name

for _,job in pairs(doorID.authorizedJobs) do
if job['name'] == ESX.PlayerData.job.name and (ESX.PlayerData.job.grade == job['grade'] or job['grade'] == -1) then
return true
end
end

@farithilman
Copy link

farithilman commented Aug 21, 2020

config.lua
authorizedJobs = { 'police' }

client/main.lua

    for _,job in pairs(doorID.authorizedJobs) do
            if job['name'] == ESX.PlayerData.job.name and and ESX.PlayerData.job.grade_name == 'boss' then
                    return true
            end
    end

try this. 'boss' refer to jobgrade=4. Check yours jobgrade name and change it.

@Mazda121
Copy link

hey boys, thanks for the enhance. do you have an idea how to add more than one grade?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

8 participants