Visible Donator Jobs Bug

Hello,

I host several DarkRP servers, I got this code so normal users can see donator jobs, but not become them.

This is the code:


	if t == TEAM_SWAT or t == TEAM_SWATSNIPER or t == TEAM_SWATMEDIC or t == TEAM_HITMAN or t == TEAM_SA or t == TEAM_PROTHIEF or t == TEAM_BMD and not self:IsUserGroup("donator") or self:IsUserGroup("donatoradmin") or self:IsUserGroup("donatortrustedadmin") or self:IsUserGroup("superadmin") or self:IsUserGroup("rootadmin") or self:IsUserGroup("owner") then
	GAMEMODE:Notify(self, 1, 4, string.format("This is a donator job! Buy donator to unlock!"))
	return 
	end

Its located in the main.lua, in the


function meta:ChangeTeam(t, force)

part.

If you’re ingame, and you are a user, you can see jobs, and you can’t become the donator jobs, so that’s good, that is working,

But when you’re one of the assignes ULX groups, for instance donator, then you still can’t become them.

Anyone knows how to fix this?

Thanks!

Just do this in your entity or job or shipment:



	customCheck = function(ply) return CLIENT or ply:IsAdmin() end


You see where it says: return CLIENT, that is what you should use to display it for everyone, and then ofc you have to fix for the groups you want instead of just ply:IsAdmin()
Then you can do this below that:



	CustomCheckFailMsg = "Message to non-admin."


But don’t forget the , behind the first customCheck function.
Oh, and the CustomCheckFail only works in the latest update of DarkRP.

Ok so would this work for my swat job:


TEAM_SWAT = AddExtraTeam("SWAT GroundUnit", {
	color = Color(0,55,255,255),
	model = {"models/player/swat.mdl",
			"models/player/riot.mdl",
			"models/player/urban.mdl",
			"models/player/gasmask.mdl",},
	description = [[You are a higher rank then the cop's. Take down the gangs that are disturbing the streets. You still have to take commands from the Cop Chief.]],
	weapons = {"weapon_bd_mp7", "weapon_real_cs_desert_eagle", "arrest_stick", "unarrest_stick", "stunstick", "door_ram", "keypad_cracker", "lockpick", "weaponchecker", "weapon_taser"},
	command = "swat",
	max = 3,
	salary = 97,
	admin = 0,
	vote = false,
	hasLicense = true
        customCheck = function(ply) 
              return CLIENT or ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "donatoradmin" or ply:GetUserGroup() == "donatortrustedadmin" or ply:GetUserGroup() == "superadmin" or ply:GetUserGroup() == "superadmins" or ply:GetUserGroup() == "rootadmin" or ply:GetUserGroup() == "owner"

        customCheckFail = "Buy donator to unlock this job!"

})

No, here:



        customCheck = function(ply) 
              return CLIENT or ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "donatoradmin" or ply:GetUserGroup() == "donatortrustedadmin" or ply:GetUserGroup() == "superadmin" or ply:GetUserGroup() == "superadmins" or ply:GetUserGroup() == "rootadmin" or ply:GetUserGroup() == "owner" end,
        customCheckFailMsg = "Buy donator to unlock this job!"


Ok this is my current code after the job:


	hasLicense = true,
	customCheck = function(ply)
	return CLIENT or ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "wolf" or ply:GetUserGroup() == "donatoradmin" or ply:GetUserGroup() == "donatortrustedadmin" or ply:GetUserGroup() == "superadmin" or ply:GetUserGroup() == "superadmins" or ply:GetUserGroup() == "rootadmin" or ply:GetUserGroup() == "owner" end,
	CustomCheckFail = "Buy donator to unlock"
})

It does work, but it just sais: You are unable to go <teamname> in a hint, and its not showing the customcheckfail

I said, update your DarkRP.

Trying to,

This: https://github.com/FPtje/DarkRP

Isnt the right site right? What is latest version? 2.4.4?

Yes, here, click this link and it will start download:

2.4.3