lua codes for darkrp HELP

I need some help with some codes… i cant find whats wrong

File one under player.lua


function meta:ChangeTeam(t, force)
	if t == TEAM_AGENT
    and !self:IsUserGroup("donor") and not self:IsSuperAdmin()
          then Notify(self, 1, 4, string.format("This job is VIP only!"))
        return
    end


other lua code is under main.lua


local AdminEnts =
{
"Ruby_Printer",
"Emerald_Printer"
}

for k,v in pairs(DarkRPEntities) do
	local function buythis(ply, args)
		if RPArrestedPlayers[ply:SteamID()] then return "" end
		if type(v.allowed) == "table" and not table.HasValue(v.allowed, ply:Team()) then
			Notify(ply, 1, 4, string.format(LANGUAGE.incorrect_job, v.cmd))
			return "" 
		end
		local cmdname = string.gsub(v.ent, " ", "_")
		local disabled = tobool(GetConVarNumber("disable"..cmdname))
		if disabled then
			Notify(ply, 1, 4, string.format(LANGUAGE.disabled, v.cmd, ""))
			return "" 
		end
	 for _k, _v in pairs(AdminEnts) do
	if v.ent == _v then
	
	     if !ply:IsUserGroup("donor") then
	Notify(ply, 1, 4, "You need to be VIP in order to buy this!")
	return ""
	end
	end
	end

You have the right idea but what u should do is put this in players.lua:

[lua]
vipteams = {TEAM_EXAMPLE} //Put the teams that you want to be restricted to a specific user group in this table like I did
if table.HasValue( vipteams, t ) and !force and !self:IsUserGroup(“supporter”) and !self:IsSuperAdmin() then //Change THISHERE where it says !self:IsUserGroup(“THISHERE”) to the name of the usergroup you want to restrict the jobs to, I kept it in the actual code as vip because… people like vip I dunno
Notify(self, 1, 4, string.format(“That class is supporter only! To become a supporter class, go on paypal and send it to sciaschi1@gmail.com”)) // You can change the message inside those quotes (“the stuff in between these brackets and text are called quotes”)
return //Please don’t touch this unless you know what you’re doing
end // Or this
[/lua]

thanks ill give it a shot… anyone have anything about the other code?

The code u gave me isn’t working right…


            vipteams = {TEAM_GRIM} //Put the teams that you want to be restricted to a specific user group in this table like I did
if table.HasValue( vipteams, t ) and !force and !self:IsUserGroup("donor") and !self:IsSuperAdmin() then //Change THISHERE where it says !self:IsUserGroup("THISHERE") to the name of the usergroup you want to restrict the jobs to, I kept it in the actual code as vip because... people like vip I dunno
   Notify(self, 1, 4, string.format("That class is supporter only! To become a supporter class, go on paypal and send it to undisclosedrpgmail.com")) // You can change the message inside those quotes ("the stuff in between these brackets and text are called quotes")
   return //Please don't touch this unless you know what you're doing
end // Or this

What admin mod are you using?

Ulx

well is it just not working? errors or anything?

I didn’t check for errors. But none popped up on the top right coroner.

all right well it seems to work on my server. You didn’t change anything else in players.lua did you?

no. ill go and try again. where about should i add it in player.lua?

ok i added it again, and nothing… i might be doing somthing wrong. i want job TEAM_grim for vip and i changed !self:IsUserGroup(“donor”) also do i need to change the

/Change THISHERE where it says !self:IsUserGroup("THISHERE") to the name of the usergroup you want to restrict the jobs
if so i also did that


           vipteams = {TEAM_GRIM} //Put the teams that you want to be restricted to a specific user group in this table like I did
if table.HasValue( vipteams, t ) and !force and !self:IsUserGroup("donor") and !self:IsSuperAdmin() then //Change THISHERE where it says !self:IsUserGroup("THISHERE") to the name of the usergroup you want to restrict the jobs to, I kept it in the actual code as vip because... people like vip I dunno
   Notify(self, 1, 4, string.format("That class is supporter only! To become a supporter class, go on paypal and send it to undisclosedrpgmail.com")) // You can change the message inside those quotes ("the stuff in between these brackets and text are called quotes")
   return //Please don't touch this unless you know what you're doing
end // Or this

well anything with a // in front of it is a comment so disregard that. show me your class you want to make donator

TEAM_GRIM TEAM_AGENT TEAM_BMD

alright. Does the actual class exist in ulx? some people forget to make it but here is what it will look like:

[lua]
vipteams = { TEAM_GRIM, TEAM_AGENT, TEAM_BMD} //Put the teams that you want to be restricted to a specific user group in this table like I did
if table.HasValue( vipteams, t ) and !force and !self:IsUserGroup(“donor”) then //Change THISHERE where it says !self:IsUserGroup(“THISHERE”) to the name of the usergroup you want to restrict the jobs to, I kept it in the actual code as vip because… people like vip I dunno
Notify(self, 1, 4, string.format(“That class is supporter only! To become a supporter class, go on paypal and send it to undisclosedrpgmail.com”)) // You can change the message inside those quotes (“the stuff in between these brackets and text are called quotes”)
return //Please don’t touch this unless you know what you’re doing
end // Or this
[/lua]

The donor groups is in the ulx ranks. and to make sure should i add this under player.lua in this area?

/---------------------------------------------------------
Teams/jobs
---------------------------------------------------------
/

heres what it should look like
[lua]
/---------------------------------------------------------
Teams/jobs
---------------------------------------------------------
/
function meta:ChangeTeam(t, force)
if RPArrestedPlayers[self:SteamID()] and not force then
if not self:Alive() then
Notify(self, 1, 4, string.format(LANGUAGE.unable, team.GetName(t), “”))
return
else
Notify(self, 1, 4, string.format(LANGUAGE.unable, team.GetName(t), “”))
return
end
end

self:SetDarkRPVar("helpBoss",false)
self:SetDarkRPVar("helpCop",false)
self:SetDarkRPVar("helpMayor",false)

		vipteams = {TEAM_MERC, TEAM_MASTERTHIEF, TEAM_BODY, TEAM_HITMAN, TEAM_InfectedZombie, TEAM_Headcrab} //Put the teams that you want to be restricted to a specific user group in this table like I did

if table.HasValue( vipteams, t ) and !force and !self:IsUserGroup(“supporter”) then //Change THISHERE where it says !self:IsUserGroup(“THISHERE”) to the name of the usergroup you want to restrict the jobs to, I kept it in the actual code as vip because… people like vip I dunno
Notify(self, 1, 4, string.format(“That class is supporter only! To become a supporter class, go on paypal and send it to blahblah”)) // You can change the message inside those quotes (“the stuff in between these brackets and text are called quotes”)
return //Please don’t touch this unless you know what you’re doing
end // Or this
[/lua]

or atleast the first part

ok well give u a shout when gmod is fix…