Donator Jobs visible for users

So I tried making my donator jobs visible for normal users by putting this code:


if t == TEAM_SWAT or t == TEAM_SWATSNIPER or t == TEAM_HITMAN and not self:IsUserGroup("donator") or self:IsUserGroup("superadmin") or self:IsUserGroup("rootadmin") or self:IsUserGroup("owner") then
	GAMEMODE:Notify(self, 1, 4, string.format("Message for non-donators.")
	return 
end

In the player.lua at function meta:ChangeTeam(t, force)

(line 208)

It looked like this:


function meta:ChangeTeam(t, force)
	if self:isArrested() and not force then
		GAMEMODE:Notify(self, 1, 4, string.format(LANGUAGE.unable, team.GetName(t), ""))
		return false
	end

	
	if t == TEAM_SWAT or t == TEAM_SWATSNIPER or t == TEAM_SWATMEDIC or t == TEAM_HITMAN or t == TEAM_SA or t == TEAM_PROTHIEF and not self:IsUserGroup("donator") or self:IsUserGroup("donatoradmin") or self:IsUserGroup("donatortrusted") 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

I left the isarrested in cause it was int he code

In my shared.lua i removed these codes at end of the donator jobs:


	customCheck = function(ply)
        return ply:GetUserGroup() == "admin" or ply:GetUserGroup() == "donatorsuperadmin" or ply:GetUserGroup() == "superadmin" or ply:GetUserGroup() == "donatorsuperadmin" or ply:GetUserGroup() == "rootadmin" or ply:GetUserGroup() == "owner"
    end

Now when i join game you get unassigned job and this is the error:


[ERROR] gamemodes/darkrp/gamemode/server/gamemode_functions.lua:497: attempt to call method 'NewData' (a nil value)
1. unknown - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:497



[ERROR] gamemodes/darkrp/gamemode/server/gamemode_functions.lua:497: attempt to call method 'NewData' (a nil value)
1. unknown - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:497

L 02/23/2013 - 16:56:51: Lua Error:
[ERROR] gamemodes/darkrp/gamemode/server/gamemode_functions.lua:593: attempt to call method 'isArrested' (a nil value)
1. unknown - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:593



[ERROR] gamemodes/darkrp/gamemode/server/gamemode_functions.lua:593: attempt to call method 'isArrested' (a nil value)
1. unknown - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:593

L 02/23/2013 - 16:56:51: Lua Error:
[ERROR] gamemodes/darkrp/gamemode/server/gamemode_functions.lua:706: attempt to call method 'isArrested' (a nil value)
1. Call - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:706
2. PlayerSpawn - gamemodes/base/gamemode/player.lua:248
3. PlayerSpawn - gamemodes/sandbox/gamemode/init.lua:41
4. unknown - gamemodes/darkrp/gamemode/server/gamemode_functions.lua:613

Anyone knows how to do it so my users can still see the jobs?

If the teams are unassigned, it means you probably missed a bracket somewhere.

Link some more errors? Preferably the ones that start when the gamemode is loaded.

I’m not exactly a great Lua Coder but try this.

[lua] tags…

It didnt work, I can’t become any job :confused: I use ULX? are these the right GetUserGroup commands?

tnx!

Seriously? ._.

There are a ‘)’ Missing at the end of GAMEMODE:Notify …
This is how it would look like:



GAMEMODE:Notify(self, 1, 4, string.format("Message for non-donators."))


Notice the Second bracket at the end, look at the errors before posting. And TRY solve them yourself.