DarkRP: Custom Police Office isn't added to the Civil Protection Gamemode

Hi,

I have been working on my DarkRP server for about a week and I just started working on custom jobs, followed TheCodingBeast’s tutorial on the topic. I am using a dedicated server and have latest versions of DarkRP and DarkRPModification.
My problem is: I have made a custom police officer in job (code below) and added it to the CivilProtection gamemode, yet when you select the job from the f4 menu it doesn’t have access any of the Civil Protection Commands, Police Agenda and can’t unlock doors set to Mayor and Civil Protection.

My Code:

\garrysmod\addons\darkrpmodification\lua\darkrp_customthings\jobs.lua


TEAM_CUSTOMCOP = DarkRP.createJob("Street Cop", {
	color = Color(25, 25, 170, 255),
	model = "models/player/Police.mdl",
	description = [[The protector of every citizen that lives in the city.
		You have the power to arrest criminals and protect innocents.
		Hit a player with your arrest baton to put them in jail.
		Bash a player with a stunstick and they may learn to obey the law.
		The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
		The Battering Ram can also unfreeze frozen props (if enabled).
		Type /wanted <name> to alert the public to the presence of a criminal.]],
	weapons = {"arrest_stick", "door_ram", "stunstick", "weaponchecker", "m9k_hk45"},
	command = "cop",
	max = 5,
	salary =20,
	admin =0,
	vote = false,
	hasLicense = true,
	ammo = {
		["pistol"] = 60,
	}
	
})


GAMEMODE.CivilProtection = {
	[TEAM_POLICE] = true,
	[TEAM_CHIEF] = true,
	[TEAM_MAYOR] = true,
	[TEAM_CUSTOMCOP] = true,
}

\garrysmod/addons/darkrpmodification/lua/darkrp_config\disabled_defaults.lua


DarkRP.disabledDefaults["jobs"] = {
	["chief"]     = true,
	["citizen"]   = false,
	["cook"]      = true, --Hungermod only
	["cp"]        = true,
	["gangster"]  = true,
	["gundealer"] = true,
	["hobo"]      = true,
	["mayor"]     = true,
	["medic"]     = true,
	["mobboss"]   = true,
}

I have figured this out,
you need to add
AddAgenda and AddDoorGroup to the bottom of darkrpmodification/lua/darkrpcustomthins/jobs.lua file.


TEAM_POLICE = DarkRP.createJob("Civil Protection", {
	color = Color(25, 25, 170, 255),
	model = {"models/player/police.mdl", "models/player/police_fem.mdl"},
	description = [[The protector of every citizen that lives in the city.
		You have the power to arrest criminals and protect innocents.
		Hit a player with your arrest baton to put them in jail.
		Bash a player with a stunstick and they may learn to obey the law.
		The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
		The Battering Ram can also unfreeze frozen props (if enabled).
		Type /wanted <name> to alert the public to the presence of a criminal.]],
	weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
	command = "cp",
	max = 4,
	salary = GAMEMODE.Config.normalsalary * 1.45,
	admin = 0,
	vote = true,
	hasLicense = true,
	ammo = {
		["pistol"] = 60,
	}
})

AddAgenda("Gangster's agenda", TEAM_MOB, {TEAM_GANG})
AddAgenda("Police agenda", TEAM_MAYOR, {TEAM_CHIEF, TEAM_POLICE})
AddDoorGroup("Cops and Mayor only", TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)
AddDoorGroup("Gundealer only", TEAM_GUN)

Glad to see you managed to resolve your own problem instead of relying on Facepunch users!

Well done.

Agreed; excellent job. By the way, here are some resources that may help you in the future ( First link contains a list of links to threads such as the “PUT ALL DarkRP QUESTIONS IN HERE / DarkRP Help” Mega-thread, DarkRP Wiki [ plus links to the most common question areas… adding shipments and jobs ] ) and much much more!:

Hey, welcome to FacePunch.
This forum is for devs that need help working on things. Here are some resources to help you get started:

Generalized Lua Help ( Links to Wikis, Answers the question of “Where do I post a simple question or DarkRP Specific question”, links to other resources compiled by forum members )
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html

Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html

If the thread questions have been solved, please mark the topic as solved by clicking “Mark As Solved” in the upper left-hand corner of the page.

Thank you