DarkRP Donator Jobs

So recently I have run into the issue of making donator jobs. I have it so that people cannot use it except the certain rank, BUT ranks above such as admin and super admin cannot use it either, only that rank.

My question is how do I make a class like ninja, donator and above ranks, such as inheritants. I am using ULX for my ranks.

Here is my code for currently filtering jobs based on rank.


	
	if (t == TEAM_NINJA and not self:IsUserGroup("vip")) then
		GAMEMODE:Notify(self, 1, 4, "You must donate for VIP to access this class.")
		return
	end

Here is the job.



TEAM_NINJA = AddExtraTeam("Ninja", {
	color = Color(204, 0, 204, 255),
	model = "models/player/arctic.mdl",
	description = [[Your objective is to raid other bases and take their stuff.
		If a cop sees you breaking in you may be arrested.
		Use your lockpick to break into peoples homes.
		You are a ninja and have an advanced lockpick!
		Also you do not have to /advert when raiding.]],
	weapons = {"pro_lockpick"},
	command = "ninja",
	max = 3,
	salary = 50,
	admin = 0,
	vote = false,
	hasLicense = false
})

[lua]or self:IsAdmin()[/lua]
But here’s an easier way to check if the player is donator or admin and higher.
[lua]TEAM_NINJA = AddExtraTeam(“Ninja”, {
color = Color(204, 0, 204, 255),
model = “models/player/arctic.mdl”,
description = [[Your objective is to raid other bases and take their stuff.
If a cop sees you breaking in you may be arrested.
Use your lockpick to break into peoples homes.
You are a ninja and have an advanced lockpick!
Also you do not have to /advert when raiding.]],
weapons = {“pro_lockpick”},
command = “ninja”,
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false,
customCheck = function(ply) return ply:IsUserGroup(“vip”) or ply:IsAdmin() end
})
[/lua]

For the code in player.lua would I remove the check if player is donator and add what you said?

If you made the check, yes. Replace it with the original file (if you want to make sure you didn’t mess something up)
And then use my code just like any other job in shared.lua

I removed the player.lua code and put the custom check in the shared.lua and just added one more or for moderator. It works perfectly! thanks man