HUD Paint Error

Hello,

I have successfully started my dedicated server running DarkRP with custom darkrp files. However when I join the game the entire right side of my screen and other peoples screen is cover by this error:
ERROR: GAMEMODE:‘HUDPaint’ Failed: [@lua\includes\extensions able.lua:103] bad argument #1 to ‘pairs’ (table expected, got number)

I have updated the server, I have tried removing the table.lua but the problem still persists, any ideas on how to fix it?

I am also running, ULX and evolve admin mods.

The error is caused by some code in a HUDPaint hook that is using a function from table.lua that is giving it a number instead of a table. So don’t delete table.lua. It’s a file of DarkRP maybe(could be any other addon also) that is using the hook and using the function wrong. In this case, the function it is using wrong is table.HasValue .

Thank you. Could it possibly be two jobs with the same colours in RBG?

No, just because the jobs are the same color it’s not effecting the syntax.

Go find the HUDPaint hook that uses table.HasValue somewhere and post the entire function here.

why are you running ULX and Evolve? That could cause conflicts possibly although I doubt it. Just find what code is causing it and put it on here.

Well, I think the error is in the shared.lua because when I have the SVN version of that file there is nothing wrong in game. But the instant I change something ie. add a new job the error starts.

Here is my table.lua





// Backwards compatibility
tablex = table

/*---------------------------------------------------------
   Name: Inherit( t, base )
   Desc: Copies any missing data from base to t
---------------------------------------------------------*/
function table.Inherit( t, base )

	for k, v in pairs( base ) do 
		if ( t[k] == nil ) then	t[k] = v end
	end
	
	t["BaseClass"] = base
	
	return t

end


/*---------------------------------------------------------
    Name: Copy(t, lookup_table)
    Desc: Taken straight from http://lua-users.org/wiki/PitLibTablestuff
          and modified to the new Lua 5.1 code by me.
          Original function by PeterPrade!
---------------------------------------------------------*/
function table.Copy(t, lookup_table)
	if (t == nil) then return nil end
	
	local copy = {}
	setmetatable(copy, getmetatable(t))
	for i,v in pairs(t) do
		if type(v) ~= "table" then
			copy* = v
		else
			lookup_table = lookup_table or {}
			lookup_table[t] = copy
			if lookup_table[v] then
				copy* = lookup_table[v] -- we already copied this table. reuse the copy.
			else
				copy* = table.Copy(v,lookup_table) -- not yet copied. copy it.
			end
		end
	end
	return copy
end

/*---------------------------------------------------------
    Name: Empty( tab )
    Desc: Empty a table
---------------------------------------------------------*/
function table.Empty( tab )

	for k, v in pairs( tab ) do
		tab[k] = nil
	end

end

/*---------------------------------------------------------
    Name: CopyFromTo( FROM, TO )
    Desc: Make TO exactly the same as FROM - but still the same table.
---------------------------------------------------------*/
function table.CopyFromTo( FROM, TO )

	// Erase values from table TO
	table.Empty( TO )
	
	// Copy values over
	table.Merge( TO, FROM )
	
end


/*---------------------------------------------------------
   Name: xx
   Desc: xx
---------------------------------------------------------*/
function table.Merge(dest, source)

	for k,v in pairs(source) do
	
		if ( type(v) == 'table' && type(dest[k]) == 'table' ) then
			-- don't overwrite one table with another;
			-- instead merge them recurisvely
			table.Merge(dest[k], v)
		else
			dest[k] = v
		end
	end
	
	return dest
	
end


/*---------------------------------------------------------
   Name: xx
   Desc: xx
---------------------------------------------------------*/
function table.HasValue( t, val )
	for k,v in pairs(t) do
		if (v == val ) then return true end
	end
	return false
end

table.InTable = HasValue


/*---------------------------------------------------------
   Name: table.Add( dest, source )
   Desc: Unlike merge this adds the two tables together and discards keys.
---------------------------------------------------------*/
function table.Add( dest, source )

	// At least one of them needs to be a table or this whole thing will fall on its ass
	if (type(source)!='table') then return dest end
	
	if (type(dest)!='table') then dest = {} end

	for k,v in pairs(source) do
		table.insert( dest, v )
	end
	
	return dest
end

/*---------------------------------------------------------
   Name: table.sortdesc( table )
   Desc: Like Lua's default sort, but descending
---------------------------------------------------------*/
function table.sortdesc( Table )

	return table.sort( Table, function(a, b) return a > b end )
end

/*---------------------------------------------------------
   Name: table.SortByKey( table )
   Desc: Returns a table sorted numerically by Key value
---------------------------------------------------------*/

function table.SortByKey( Table, Desc )

	local temp = {}

	for key, _ in pairs(Table) do table.insert(temp, key) end
	if ( Desc ) then
		table.sort(temp, function(a, b) return Table[a] < Table** end)
	else
		table.sort(temp, function(a, b) return Table[a] > Table** end)
	end

	return temp
end

/*---------------------------------------------------------
   Name: table.Count( table )
   Desc: Returns the number of keys in a table
---------------------------------------------------------*/

function table.Count (t)
  local i = 0
  for k in pairs(t) do i = i + 1 end
  return i
end


/*---------------------------------------------------------
   Name: table.Random( table )
   Desc: Return a random key
---------------------------------------------------------*/

function table.Random (t)
  
  local rk = math.random( 1, table.Count( t ) )
  local i = 1
  for k, v in pairs(t) do 
	if ( i == rk ) then return v end
	i = i + 1 
  end

end


/*----------------------------------------------------------------------
   Name: table.IsSequential( table )
   Desc: Returns true if the tables 
	 keys are sequential
-----------------------------------------------------------------------*/

function table.IsSequential(t)
	local i = 1
	for key, value in pairs (t) do
		if not tonumber(i) or key ~= i then return false end
		i = i + 1
	end
	return true
end


/*---------------------------------------------------------
   Name: table.ToString( table,name,nice )
   Desc: Convert a simple table to a string
		table = the table you want to convert (table)
		name  = the name of the table (string)
		nice  = whether to add line breaks and indents (bool)
---------------------------------------------------------*/

function table.ToString(t,n,nice)
	local 		nl,tab  = "",  ""
	if nice then 	nl,tab = "
", "	"	end

	local function MakeTable ( t, nice, indent, done)
		local str = ""
		local done = done or {}
		local indent = indent or 0
		local idt = ""
		if nice then idt = string.rep ("	", indent) end

		local sequential = table.IsSequential(t)

		for key, value in pairs (t) do

			str = str .. idt .. tab .. tab

			if not sequential then
				if type(key) == "number" or type(key) == "boolean" then 
					key ='['..tostring(key)..']' ..tab..'='
				else
					key = tostring(key) ..tab..'='
				end
			else
				key = ""
			end

			if type (value) == "table" and not done [value] then

				done [value] = true
				str = str .. key .. tab .. '{' .. nl
				.. MakeTable (value, nice, indent + 1, done)
				str = str .. idt .. tab .. tab ..tab .. tab .."},".. nl

			else
				
				if 	type(value) == "string" then 
					value = '"'..tostring(value)..'"'
				elseif  type(value) == "Vector" then
					value = 'Vector('..value.x..','..value.y..','..value.z..')'
				elseif  type(value) == "Angle" then
					value = 'Angle('..value.pitch..','..value.yaw..','..value.roll..')'
				else
					value = tostring(value)
				end
				
				str = str .. key .. tab .. value .. ",".. nl

			end

		end
		return str
	end
	local str = ""
	if n then str = n.. tab .."=" .. tab end
	str = str .."{" .. nl .. MakeTable ( t, nice) .. "}"
	return str
end

/*---------------------------------------------------------
   Name: table.Sanitise( table )
   Desc: Converts a table containing vectors, angles, bools so it can be converted to and from keyvalues
---------------------------------------------------------*/
function table.Sanitise( t, done )

	local done = done or {}
	local tbl = {}

	for k, v in pairs ( t ) do
	
		if ( type( v ) == "table" and !done[ v ] ) then

			done[ v ] = true
			tbl[ k ] = table.Sanitise ( v, done )

		else

			if ( type(v) == "Vector" ) then

				local x, y, z = v.x, v.y, v.z
				if y == 0 then y = nil end
				if z == 0 then z = nil end
				tbl[k] = { __type = "Vector", x = x, y = y, z = z }

			elseif ( type(v) == "Angle" ) then

				local p,y,r = v.pitch, v.yaw, v.roll
				if p == 0 then p = nil end
				if y == 0 then y = nil end
				if r == 0 then r = nil end
				tbl[k] = { __type = "Angle", p = p, y = y, r = r }

			elseif ( type(v) == "boolean" ) then
			
				tbl[k] = { __type = "Bool", tostring( v ) }

			else
			
				tbl[k] = tostring(v)

			end
			
			
		end
		
		
	end
	
	return tbl
	
end


/*---------------------------------------------------------
   Name: table.DeSanitise( table )
   Desc: Converts a Sanitised table back
---------------------------------------------------------*/
function table.DeSanitise( t, done )

	local done = done or {}
	local tbl = {}

	for k, v in pairs ( t ) do
	
		if ( type( v ) == "table" and !done[ v ] ) then
		
			done[ v ] = true

			if ( v.__type ) then
			
				if ( v.__type == "Vector" ) then
				
					tbl[ k ] = Vector( v.x, v.y, v.z )
				
				elseif ( v.__type == "Angle" ) then
				
					tbl[ k ] = Angle( v.p, v.y, v.r )
					
				elseif ( v.__type == "Bool" ) then
					
					tbl[ k ] = ( v[1] == "true" )
					
				end
			
			else
			
				tbl[ k ] = table.DeSanitise( v, done )
				
			end
			
		else
		
			tbl[ k ] = v
			
		end
		
	end
	
	return tbl
	
end

function table.ForceInsert( t, v )

	if ( t == nil ) then t = {} end
	
	table.insert( t, v )
	
end


/*---------------------------------------------------------
   Name: table.SortByMember( table )
   Desc: Sorts table by named member
---------------------------------------------------------*/
function table.SortByMember( Table, MemberName, bAsc )

	local TableMemberSort = function( a, b, MemberName, bReverse ) 
	
		//
		// All this error checking kind of sucks, but really is needed
		//
		if ( type(a) != "table" ) then return !bReverse end
		if ( type(b) != "table" ) then return bReverse end
		if ( !a[MemberName] ) then return !bReverse end
		if ( !b[MemberName] ) then return bReverse end
	
		if ( bReverse ) then
			return a[MemberName] < b[MemberName]
		else
			return a[MemberName] > b[MemberName]
		end
		
	end

	table.sort( Table, function(a, b) return TableMemberSort( a, b, MemberName, bAsc or false ) end )
	
end


/*---------------------------------------------------------
   Name: table.LowerKeyNames( table )
   Desc: Lowercase the keynames of all tables
---------------------------------------------------------*/
function table.LowerKeyNames( Table )

	local OutTable = {}

	for k, v in pairs( Table ) do
	
		// Recurse
		if ( type( v ) == "table" ) then
			v = table.LowerKeyNames( v )
		end
		
		OutTable[ k ] = v
		
		if ( type( k ) == "string" ) then
	
			OutTable[ k ]  = nil
			OutTable[ string.lower( k ) ] = v
		
		end		
	
	end
	
	return OutTable
	
end


/*---------------------------------------------------------
   Name: table.LowerKeyNames( table )
   Desc: Lowercase the keynames of all tables
---------------------------------------------------------*/
function table.CollapseKeyValue( Table )

	local OutTable = {}
	
	for k, v in pairs( Table ) do
	
		local Val = v.Value
	
		if ( type( Val ) == "table" ) then
			Val = table.CollapseKeyValue( Val )
		end
		
		OutTable[ v.Key ] = Val
	
	end
	
	return OutTable

end

/*---------------------------------------------------------
   Name: table.ClearKeys( table, bSaveKey )
   Desc: Clears the keys, converting to a numbered format
---------------------------------------------------------*/
function table.ClearKeys( Table, bSaveKey )

	local OutTable = {}
	
	for k, v in pairs( Table ) do
		if ( bSaveKey ) then
			v.__key = k
		end
		table.insert( OutTable, v )	
	end
	
	return OutTable

end



local function fnPairsSorted( pTable, Index )

	if ( Index == nil ) then
	
		Index = 1
	
	else
	
		for k, v in pairs( pTable.__SortedIndex ) do
			if ( v == Index ) then
				Index = k + 1
				break
			end
		end
		
	end
	
	local Key = pTable.__SortedIndex[ Index ]
	if ( !Key ) then
		pTable.__SortedIndex = nil
		return
	end
	
	Index = Index + 1
	
	return Key, pTable[ Key ]

end

/*---------------------------------------------------------
   A Pairs function

		Sorted by TABLE KEY
		
---------------------------------------------------------*/
function SortedPairs( pTable, Desc )

	pTable = table.Copy( pTable )
	
	local SortedIndex = {}
	for k, v in pairs( pTable ) do
		table.insert( SortedIndex, k )
	end
	
	if ( Desc ) then
		table.sort( SortedIndex, function(a,b) return a>b end )
	else
		table.sort( SortedIndex )
	end
	pTable.__SortedIndex = SortedIndex

	return fnPairsSorted, pTable, nil
	
end

/*---------------------------------------------------------
   A Pairs function

		Sorted by VALUE
		
---------------------------------------------------------*/
function SortedPairsByValue( pTable, Desc )

	pTable = table.ClearKeys( pTable )
	
	if ( Desc ) then
		table.sort( pTable, function(a,b) return a>b end )
	else
		table.sort( pTable )
	end

	return ipairs( pTable )
	
end

/*---------------------------------------------------------
   A Pairs function

		Sorted by Member Value (All table entries must be a table!)
		
---------------------------------------------------------*/
function SortedPairsByMemberValue( pTable, pValueName, Desc )

	Desc = Desc or false
	
	local pSortedTable = table.ClearKeys( pTable, true )
	
	table.SortByMember( pSortedTable, pValueName, !Desc )
	
	local SortedIndex = {}
	for k, v in ipairs( pSortedTable ) do
		table.insert( SortedIndex, v.__key )
	end
	
	pTable.__SortedIndex = SortedIndex

	return fnPairsSorted, pTable, nil
	
end

/*---------------------------------------------------------
   A Pairs function		
---------------------------------------------------------*/
function RandomPairs( pTable, Desc )

	local Count = table.Count( pTable )
	pTable = table.Copy( pTable )
	
	local SortedIndex = {}
	for k, v in pairs( pTable ) do
		table.insert( SortedIndex, { key = k, val = math.random( 1, 1000 ) } )
	end
	
	if ( Desc ) then
		table.sort( SortedIndex, function(a,b) return a.val>b.val end )
	else
		table.sort( SortedIndex, function(a,b) return a.val<b.val end )
	end
	
	for k, v in pairs( SortedIndex ) do
		SortedIndex[ k ] = v.key;
	end
	
	pTable.__SortedIndex = SortedIndex

	return fnPairsSorted, pTable, nil
	
end

/*---------------------------------------------------------
	GetFirstKey
---------------------------------------------------------*/
function table.GetFirstKey( t )

	local k, v = next( t )
	return k
	
end

function table.GetFirstValue( t )

	local k, v = next( t )
	return v
	
end

function table.GetLastKey( t )

	local k, v = next( t, table.Count(t) )
	return k
	
end

function table.GetLastValue( t )

	local k, v = next( t, table.Count(t) )
	return v
	
end

function table.FindNext( tab, val )
	
	local bfound = false
	for k, v in pairs( tab ) do
		if ( bfound ) then return v end
		if ( val == v ) then bfound = true end
	end
	
	return table.GetFirstValue( tab )	
	
end

function table.FindPrev( tab, val )
	
	local last = table.GetLastValue( tab )
	for k, v in pairs( tab ) do
		if ( val == v ) then return last end
		last = v
	end
	
	return last
	
end

function table.GetWinningKey( tab )
	
	local highest = -10000
	local winner = nil
	
	for k, v in pairs( tab ) do
		if ( v > highest ) then 
			winner = k
			highest = v
		end
	end
	
	return winner
	
end


I really appreciate the help guys. I use two admin mods, because I like the functions both of them offer me, but if they are causing the problem I will get rid of one.

Solution: Make your own admin mod. Contains the functions you’ve ever wanted.

there is nothing wrong with table.lua
Please post the SVN version of shared.lua, and then the version you made, so we can see what you did wrong.

everyone rate gay_trooper dumb


(User was permabanned for this post ("shit off" - garry))

Here is the SVN version of shared.lua



/*--------------------------------------------------------
Default teams. If you make a team above the citizen team, people will spawn with that team!
--------------------------------------------------------*/
TEAM_CITIZEN = AddExtraTeam("Citizen", Color(20, 150, 20, 255), {
	"models/player/Group01/Female_01.mdl",
	"models/player/Group01/Female_02.mdl",
	"models/player/Group01/Female_03.mdl",
	"models/player/Group01/Female_04.mdl",
	"models/player/Group01/Female_06.mdl",
	"models/player/Group01/Female_07.mdl",
	"models/player/group01/male_01.mdl",
	"models/player/Group01/Male_02.mdl",
	"models/player/Group01/male_03.mdl",
	"models/player/Group01/Male_04.mdl",
	"models/player/Group01/Male_05.mdl",
	"models/player/Group01/Male_06.mdl",
	"models/player/Group01/Male_07.mdl",
	"models/player/Group01/Male_08.mdl",
	"models/player/Group01/Male_09.mdl"},
[[The Citizen is the most basic level of society you can hold
besides being a hobo. 
You have no specific role in city life.]], {}, "citizen", 0, 45, 0, false, false)

TEAM_POLICE = AddExtraTeam("Civil Protection", Color(25, 25, 170, 255), "models/player/police.mdl", [[The protector of every citizen that lives in the city . 
You have the power to arrest criminals and protect innocents. 
Hit them with your arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to disobey 
the law.
The Battering Ram can break down the door of a criminal with a warrant 
for his/her arrest.
The Battering Ram can also unfreeze frozen props(if enabled).
Type /wanted <name> to alert the public to this criminal
OR go to tab and warrant someone by clicking the warrant button]], {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"}, "cp", 4, 65, 0, true, true)

TEAM_GANG = AddExtraTeam("Gangster", Color(75, 75, 75, 255), {
	"models/player/Group03/Female_01.mdl",
	"models/player/Group03/Female_02.mdl",
	"models/player/Group03/Female_03.mdl",
	"models/player/Group03/Female_04.mdl",
	"models/player/Group03/Female_06.mdl",
	"models/player/Group03/Female_07.mdl",
	"models/player/group03/male_01.mdl",
	"models/player/Group03/Male_02.mdl",
	"models/player/Group03/male_03.mdl",
	"models/player/Group03/Male_04.mdl",
	"models/player/Group03/Male_05.mdl",
	"models/player/Group03/Male_06.mdl",
	"models/player/Group03/Male_07.mdl",
	"models/player/Group03/Male_08.mdl",
	"models/player/Group03/Male_09.mdl"}, [[The lowest person of crime. 
A gangster generally works for the Mobboss who runs the crime family. 
The Mobboss sets your agenda and you follow it or you might be punished.]], {}, "gangster", 3, 45, 0, false, false)

TEAM_MOB = AddExtraTeam("Mob boss", Color(25, 25, 25, 255), "models/player/gman_high.mdl", [[The Mobboss is the boss of the criminals in the city. 
With his power he coordinates the gangsters and forms an efficent crime
organization. 
He has the ability to break into houses by using a lockpick. 
The Mobboss also can unarrest you.]], {"lockpick", "unarrest_stick"}, "mobboss", 1, 60, 0, false, false)

TEAM_GUN = AddExtraTeam("Gun Dealer", Color(255, 140, 0, 255), "models/player/monk.mdl", [[A gun dealer is the only person who can sell guns to other 
people. 
However, make sure you aren't caught selling guns that are illegal to 
the public.
/Buyshipment <name> to Buy a  weapon shipment
/Buygunlab to Buy a gunlab that spawns P228 pistols]], {}, "gundealer", 2, 45, 0, false, false)

TEAM_MEDIC = AddExtraTeam("Medic", Color(47, 79, 79, 255), "models/player/kleiner.mdl", [[With your medical knowledge, you heal players to proper 
health. 
Without a medic, people can not be healed. 
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit to heal yourself.]], {"med_kit"}, "medic", 3, 45, 0, false, false)

TEAM_COOK = AddExtraTeam("Cook", Color(238, 99, 99, 255), "models/player/mossman.mdl", [[As a cook, it is your responsibility to feed the other members 
of your city. 
You can spawn a microwave and sell the food you make:
/Buymicrowave]], {}, "cook", 2, 45, 0, 0, false)

TEAM_CHIEF = AddExtraTeam("Civil Protection Chief", Color(20, 20, 255, 255), "models/player/combine_soldier_prisonguard.mdl", [[The Chief is the leader of the Civil Protection unit. 
Coordinate the police forces to bring law to the city
Hit them with arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to 
disobey the law.
The Battering Ram can break down the door of a criminal with a 
warrant for his/her arrest.
Type /wanted <name> to alert the public to this criminal
Type /jailpos to set the Jail Position]], {"arrest_stick", "unarrest_stick", "weapon_deagle2", "stunstick", "door_ram", "weaponchecker"}, "chief", 1, 75, 0, false, true, TEAM_POLICE)

TEAM_MAYOR = AddExtraTeam("Mayor", Color(150, 20, 20, 255), "models/player/breen.mdl", [[The Mayor of the city creates laws to serve the greater good 
of the people.
If you are the mayor you may create and accept warrants.
Type /wanted <name>  to warrant a player
Type /jailpos to set the Jail Position
Type /lockdown initiate a lockdown of the city. 
Everyone must be inside during a lockdown. 
The cops patrol the area
/unlockdown to end a lockdown]], {}, "mayor", 1, 85, 0, true, false/*, {TEAM_CHIEF, TEAM_POLICE}*/)
/*
--------------------------------------------------------
HOW TO MAKE AN EXTRA CLASS!!!!
--------------------------------------------------------

You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you're doing!!!
Ok here's how:

To make an extra class do this:
AddExtraTeam( "<NAME OF THE CLASS>", Color(<red>, <Green>, <blue>, 255), "<Player model>" , [[<the description(it can have enters)>]], { "<first extra weapon>","<second extra weapon>", etc...}, "<chat command to become it(WITHOUT THE /!)>", <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>,  true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)

The real example is here: it's the Hobo:		*/

--VAR without /!!!			The name    the color(what you see in tab)                   the player model					The description
TEAM_HOBO = AddExtraTeam("Hobo", Color(80, 45, 0, 255), "models/player/corpse1.mdl", [[The lowest member of society. All people see you laugh. 
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or 
outside someone else's door]], {"weapon_bugbait"}, "hobo", 5, 0, 0, false)
//No extra weapons           say /hobo to become hobo  Maximum hobo's = 5		his salary = 0 because hobo's don't earn money.          0 = everyone can become hobo ,      false = you don't have to vote to become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!!!!
// HAVING "/dude" IN THE COMMAND FIELD IS WROOOOOOOONG!!!!
//ADD TEAMS UNDER THIS LINE:









/*
--------------------------------------------------------
HOW TO MAKE A DOOR GROUP
--------------------------------------------------------
AddDoorGroup("NAME OF THE GROUP HERE, you see this when looking at a door", Team1, Team2, team3, team4, etc.)

WARNING: THE DOOR GROUPS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!


The default door groups, can also be used as examples:
*/
AddDoorGroup("cops and mayor only", TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)
AddDoorGroup("gundealer only", TEAM_GUN)


/*
--------------------------------------------------------
HOW TO MAKE An agenda
--------------------------------------------------------
AddAgenda(Title of the agenda, Manager (who edits it), Listeners (the ones who just see and follow the agenda))

WARNING: THE AGENDAS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!

The default agenda's, can also be used as examples:
*/
AddAgenda("Gangster's agenda", TEAM_MOB, {TEAM_GANG})
AddAgenda("Police agenda", TEAM_MAYOR, {TEAM_CHIEF, TEAM_POLICE})


Any here is my version.




/*--------------------------------------------------------
Default teams. If you make a team above the citizen team, people will spawn with that team!
--------------------------------------------------------*/
TEAM_CITIZEN = AddExtraTeam("Citizen", Color(20, 150, 20, 255), {
	"models/player/Group01/Female_01.mdl",
	"models/player/Group01/Female_02.mdl",
	"models/player/Group01/Female_03.mdl",
	"models/player/Group01/Female_04.mdl",
	"models/player/Group01/Female_06.mdl",
	"models/player/Group01/Female_07.mdl",
	"models/player/group01/male_01.mdl",
	"models/player/Group01/Male_02.mdl",
	"models/player/Group01/male_03.mdl",
	"models/player/Group01/Male_04.mdl",
	"models/player/Group01/Male_05.mdl",
	"models/player/Group01/Male_06.mdl",
	"models/player/Group01/Male_07.mdl",
	"models/player/Group01/Male_08.mdl",
	"models/player/Group01/Male_09.mdl"},
[[The Citizen is the most basic level of society you can hold
besides being a hobo. 
You have no specific role in city life.]], {"weapon_mad_fists"}, "citizen", 0, 45, 0, false, false)

TEAM_POLICE = AddExtraTeam("Civil Protection", Color(25, 25, 170, 255), "models/player/police.mdl", [[The protector of every citizen that lives in the city . 
You have the power to arrest criminals and protect innocents. 
Hit them with your arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to disobey 
the law.
The Battering Ram can break down the door of a criminal with a warrant 
for his/her arrest.
The Battering Ram can also unfreeze frozen props(if enabled).
Type /wanted <name> to alert the public to this criminal
OR go to tab and warrant someone by clicking the warrant button]], {"arrest_stick", "unarrest_stick", "weapon_mad_p228", "weapon_mad_fists", "stunstick", "taser", "door_ram", "weaponchecker"}, "cp", 4, 65, 0, true, true)

TEAM_GANG = AddExtraTeam("Mafia Member", Color(75, 75, 75, 255), {
	"models/player/Group03/Female_01.mdl",
	"models/player/Group03/Female_02.mdl",
	"models/player/Group03/Female_03.mdl",
	"models/player/Group03/Female_04.mdl",
	"models/player/Group03/Female_06.mdl",
	"models/player/Group03/Female_07.mdl",
	"models/player/group03/male_01.mdl",
	"models/player/Group03/Male_02.mdl",
	"models/player/Group03/male_03.mdl",
	"models/player/Group03/Male_04.mdl",
	"models/player/Group03/Male_05.mdl",
	"models/player/Group03/Male_06.mdl",
	"models/player/Group03/Male_07.mdl",
	"models/player/Group03/Male_08.mdl",
	"models/player/Group03/Male_09.mdl"}, [[The lowest person of crime. 
A mafia member generally works for the Mobboss who runs the crime family. 
The Mobboss sets your agenda and you follow it or you might be punished.]], {"weapon_mad_fists"}, "mafia", 3, 45, 0, false, false)

TEAM_MOB = AddExtraTeam("Mafia Boss", Color(25, 25, 25, 255), "models/player/gman_high.mdl", [[The Mobboss is the boss of the criminals in the city. 
With his power he coordinates the mafia members and forms an efficent crime
organization. 
He has the ability to break into houses by using a lockpick. 
The Mobboss also can unarrest you.]], {"weapon_mad_fists", "lockpick", "unarrest_stick"}, "mobboss", 1, 60, 0, false, false)

TEAM_GUN = AddExtraTeam("Gun Dealer", Color(255, 140, 0, 255), "models/player/odessa.mdl", [[A gun dealer is the only person who can sell guns to other 
people. 
However, make sure you aren't caught selling guns that are illegal to 
the public.
/Buyshipment <name> to Buy a  weapon shipment
/Buygunlab to Buy a gunlab that spawns P228 pistols]], {"weapon_mad_fists"}, "gundealer", 2, 45, 0, false, false)

TEAM_MEDIC = AddExtraTeam("Medic", Color(47, 79, 79, 255), "models/player/kleiner.mdl", [[With your medical knowledge, you heal players to proper 
health. 
Without a medic, people can not be healed. 
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit to heal yourself.]], {"med_kit", "weapon_mad_fists"}, "medic", 3, 45, 0, false, false)

TEAM_COOK = AddExtraTeam("Cook", Color(238, 99, 99, 255), "models/player/mossman.mdl", [[As a cook, it is your responsibility to feed the other members 
of your city. 
You can spawn a microwave and sell the food you make:
/Buymicrowave]], {"weapon_mad_fists"}, "cook", 2, 45, 0, 0, false)

TEAM_CHIEF = AddExtraTeam("Civil Protection Chief", Color(20, 20, 255, 255), "models/player/combine_soldier_prisonguard.mdl", [[The Chief is the leader of the Civil Protection unit. 
Coordinate the police forces to bring law to the city
Hit them with arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to 
disobey the law.
The Battering Ram can break down the door of a criminal with a 
warrant for his/her arrest.
Type /wanted <name> to alert the public to this criminal
Type /jailpos to set the Jail Position]], {"weapon_mad_fists", "arrest_stick", "unarrest_stick", "weapon_mad_p228", "stunstick", "taser", "door_ram", "weaponchecker"}, "chief", 1, 85, 0, false, true, TEAM_POLICE)

TEAM_MAYOR = AddExtraTeam("Mayor", Color(150, 20, 20, 255), "models/player/breen.mdl", [[The Mayor of the city creates laws to serve the greater good 
of the people.
If you are the mayor you may create and accept warrants.
Type /wanted <name>  to warrant a player
Type /jailpos to set the Jail Position
Type /lockdown initiate a lockdown of the city. 
Everyone must be inside during a lockdown. 
The cops patrol the area
/unlockdown to end a lockdown]], {"weapon_mad_fists"}, "mayor", 1, 95, 0, true, false/*, {TEAM_CHIEF, TEAM_POLICE}*/)
/*
--------------------------------------------------------
HOW TO MAKE AN EXTRA CLASS!!!!
--------------------------------------------------------

You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you're doing!!!
Ok here's how:

To make an extra class do this:
AddExtraTeam( "<NAME OF THE CLASS>", Color(<red>, <Green>, <blue>, 255), "<Player model>" , [[<the description(it can have enters)>]], { "<first extra weapon>","<second extra weapon>", etc...}, "<chat command to become it(WITHOUT THE /!)>", <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>,  true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)

The real example is here: it's the Hobo:		*/

--VAR without /!!!			The name    the color(what you see in tab)                   the player model					The description
TEAM_HOBO = AddExtraTeam("Hobo", Color(80, 45, 0, 255), "models/player/corpse1.mdl", [[The lowest member of society. All people see you laugh. 
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or 
outside someone else's door]], {""}, "hobo", 5, 0, 0, false)
//No extra weapons           say /hobo to become hobo  Maximum hobo's = 5		his salary = 0 because hobo's don't earn money.          0 = everyone can become hobo ,      false = you don't have to vote to become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!!!!
// HAVING "/dude" IN THE COMMAND FIELD IS WROOOOOOOONG!!!!
//ADD TEAMS UNDER THIS LINE:

TEAM_HOOKER= AddExtraTeam("Hooker", Color(252, 7, 255, 255), "Models/Characters/Elexis/naked_elexis.mdl", [[As a hooker it is your responsibility to supply the town with 
plenty of sex. Charge people as much as you like.]], {"weapon_mad_fists"}, "hooker", 2, 45, 0, false, false)

TEAM_BANK = AddExtraTeam("Banker", Color(41, 143, 230, 255), "models/player/hostage/hostage_01.mdl", [[As a Banker, your sole responsibility is to bank players
money and earn interest on it. You will use
StarBankRedux to manage your affairs.
Use /buybankpc to use it.]], {"weapon_mad_fists"}, "banker", 2, 45, 0, false, false)

TEAM_CLEANER = AddExtraTeam("Cleaner", Color(255, 255, 0, 255), "models/player/hostage/hostage_03.mdl", [[As a cleaner it is your responsibility to ensure
that the town is clean.]], {"weapon_mad_fists, weapon_broom"}, "cleaner", 2, 55, 0, false, false)

TEAM_DRUG = AddExtraTeam("Drug Dealer", Color(150, 41, 234, 255), {
	"models/player/Group01/Female_01.mdl",
	"models/player/Group01/Female_02.mdl",
	"models/player/Group01/Female_03.mdl",
	"models/player/Group01/Female_04.mdl",
	"models/player/Group01/Female_06.mdl",
	"models/player/Group01/Female_07.mdl",
	"models/player/group01/male_01.mdl",
	"models/player/Group01/Male_02.mdl",
	"models/player/Group01/male_03.mdl",
	"models/player/Group01/Male_04.mdl",
	"models/player/Group01/Male_05.mdl",
	"models/player/Group01/Male_06.mdl",
	"models/player/Group01/Male_07.mdl",
	"models/player/Group01/Male_08.mdl",
	"models/player/Group01/Male_09.mdl"}, [[A Drug Dealers sole purpose is to supply drugs to the town,
	be wary that police are always on alert to any suspision of 
	drugs]], {"weapon_mad_fists"}, "drugdealer", 2, 45, 0, false, false)

TEAM_HITMAN = AddExtraTeam("Hitman", Color(135, 135, 135, 255), {
	"models/player/Group01/Female_01.mdl",
	"models/player/Group01/Female_02.mdl",
	"models/player/Group01/Female_03.mdl",
	"models/player/Group01/Female_04.mdl",
	"models/player/Group01/Female_06.mdl",
	"models/player/Group01/Female_07.mdl",
	"models/player/group01/male_01.mdl",
	"models/player/Group01/Male_02.mdl",
	"models/player/Group01/male_03.mdl",
	"models/player/Group01/Male_04.mdl",
	"models/player/Group01/Male_05.mdl",
	"models/player/Group01/Male_06.mdl",
	"models/player/Group01/Male_07.mdl",
	"models/player/Group01/Male_08.mdl",
	"models/player/Group01/Male_09.mdl"}, [[As a Hitman, you are hired by people to 
kill people. You accept money for your 
services and must not RDM.]], {"weapon_mad_fists", "weapon_mad_knife"}, "hitman", 3, 45, 0, false, false)









/*
--------------------------------------------------------
HOW TO MAKE A DOOR GROUP
--------------------------------------------------------
AddDoorGroup("NAME OF THE GROUP HERE, you see this when looking at a door", Team1, Team2, team3, team4, etc.)

WARNING: THE DOOR GROUPS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!


The default door groups, can also be used as examples:
*/
AddDoorGroup("Mayor and Police Only.", TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)


/*
--------------------------------------------------------
HOW TO MAKE An agenda
--------------------------------------------------------
AddAgenda(Title of the agenda, Manager (who edits it), Listeners (the ones who just see and follow the agenda))

WARNING: THE AGENDAS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!

The default agenda's, can also be used as examples:
*/
AddAgenda("Gangster's agenda", TEAM_MOB, {TEAM_GANG})
AddAgenda("Police agenda", TEAM_MAYOR, TEAM_CHEIF, {TEAM_POLICE})


Try finding the darkrp file, holding the hud. And post it.

Here’s a solution that I use with these errors: Replace the function that errors with one that issues debug.Trace() when it’s about to error. Gives you exactly what borkd.

For example, in this case, one could run this:
[lua]
/---------------------------------------------------------
Name: xx
Desc: xx
---------------------------------------------------------
/
function table.HasValue( t, val )
if t == nil then debug.Trace() end
for k,v in pairs(t) do
if (v == val ) then return true end
end
return false
end

table.InTable = HasValue

[/lua]
In most cases you can just stuff this to a file and run it on the client.

DarkRP SVN comes with DRPSkin.lua…but that’s just a skin.

cl_init.lua has the scoreboard and bottom left “Money, Salary, Job, Health” thing.

cl_vgui.lua has the F4 stuff.

last line - you changed it from
AddAgenda(“Police agenda”, TEAM_MAYOR, {TEAM_CHIEF, TEAM_POLICE})
to
AddAgenda(“Police agenda”, TEAM_MAYOR, TEAM_CHEIF, {TEAM_POLICE})
Change it back and it’ll work fine. I guess you were trying to make it so the Chief (Remember: “I before E except after C unless it isn’t because the English language is a horrible missmash of other languages and apparently ungovernable by any overriding rules.”) could edit the agenda as well as the mayor. This isn’t possible. Unless you edit how agendas work, you’ll have to stick with one can edit, many can see.

I can’t recall how many of these threads I’ve seen before. Is it really so hard for these RP gamemodes to write up a job configuration window instead of making clueless users wade knee-deep in spaghetti code?

Funny joke, you’re talking about Ftpje here.

It worked! Bloody spelling errors eh. Thank you.