DarkRP: Setting Armor based on Jobs

I’m trying to set armor on players based on their jobs, but I’m having issues. I’m not getting any errors, but players simply do not spawn with armor. Look at the police jobs and tell me if my method is correct please?


--[[---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------

This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.

Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
	Once you've done that, copy and paste the job to this file and edit it.

The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua

For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields


Add jobs under the following line:
---------------------------------------------------------------------------]]
TEAM_CITIZEN = DarkRP.createJob("Citizen", {
	color = Color(20, 150, 20, 255),
	model = {
		"models/ocrp2players/clothes1/10/male_01.mdl",
		"models/ocrp2players/clothes1/10/female_01.mdl",
		"models/ocrp2players/clothes1/10/male_02.mdl",
		"models/ocrp2players/clothes1/10/female_02.mdl",
		"models/ocrp2players/clothes1/10/male_03.mdl",
		"models/ocrp2players/clothes1/10/female_03.mdl",
		"models/ocrp2players/clothes1/10/male_04.mdl",
		"models/ocrp2players/clothes1/10/female_04.mdl",
		"models/ocrp2players/clothes1/10/male_05.mdl",
		"models/ocrp2players/clothes1/10/male_06.mdl",
		"models/ocrp2players/clothes1/10/female_06.mdl",
		"models/ocrp2players/clothes1/10/male_07.mdl",
		"models/ocrp2players/clothes1/10/female_07.mdl",
		"models/ocrp2players/clothes1/10/male_08.mdl",
		"models/ocrp2players/clothes1/10/male_09.mdl",
	},
	description = [[No specific role in city life. Make your own roleplay story!]],
	weapons = {"m9k_fists"},
	command = "citizen",
	max = 0,
	salary = 100,
	admin = 0,
	vote = false,
	hasLicense = false,
	candemote = false
})


TEAM_BMD = DarkRP.createJob("Black Market Dealer", {
	color = Color(53, 45, 45, 255),
	model = "models/player/monk.mdl",
	description = [[Sell "less-than-legal" substances to the citizens of EvoCity.]],
	weapons = {"m9k_fists"},
	command = "bmd",
	max = 2,
	salary = 120,
	admin = 0,
	vote = false,
	hasLicense = false,
	candemote = false
})



TEAM_TAXI = DarkRP.createJob("Taxi Driver", {
	color = Color(205, 212, 16, 255),
	model = {
		"models/ocrp2players/clothes1/10/male_01.mdl",
		"models/ocrp2players/clothes1/10/female_01.mdl",
		"models/ocrp2players/clothes1/10/male_02.mdl",
		"models/ocrp2players/clothes1/10/female_02.mdl",
		"models/ocrp2players/clothes1/10/male_03.mdl",
		"models/ocrp2players/clothes1/10/female_03.mdl",
		"models/ocrp2players/clothes1/10/male_04.mdl",
		"models/ocrp2players/clothes1/10/female_04.mdl",
		"models/ocrp2players/clothes1/10/male_05.mdl",
		"models/ocrp2players/clothes1/10/male_06.mdl",
		"models/ocrp2players/clothes1/10/female_06.mdl",
		"models/ocrp2players/clothes1/10/male_07.mdl",
		"models/ocrp2players/clothes1/10/female_07.mdl",
		"models/ocrp2players/clothes1/10/male_08.mdl",
		"models/ocrp2players/clothes1/10/male_09.mdl",
	},
	description = [[Drive other players around the map for money.]],
	weapons = {"m9k_fists"},
	command = "taxidriver",
	max = 3,
	salary = 130,
	admin = 0,
	vote = false,
	hasLicense = false,
	candemote = false
})


TEAM_POLICE = DarkRP.createJob("Police Officer", {
	color = Color(25, 25, 170, 255),
	model = {"models/ocrp2players/police/l1/male_01.mdl", 
	"models/ocrp2players/police/l1/female_01.mdl",
	"models/ocrp2players/police/l1/male_02.mdl", 
	"models/ocrp2players/police/l1/female_02.mdl",
	"models/ocrp2players/police/l1/male_03.mdl",
	"models/ocrp2players/police/l1/female_03.mdl",
	"models/ocrp2players/police/l1/male_04.mdl",
	"models/ocrp2players/police/l1/female_04.mdl",
	"models/ocrp2players/police/l1/male_05.mdl",
	"models/ocrp2players/police/l1/male_06.mdl",
	"models/ocrp2players/police/l1/female_06.mdl",
	"models/ocrp2players/police/l1/male_07.mdl",
	"models/ocrp2players/police/l1/female_07.mdl",
	"models/ocrp2players/police/l1/male_08.mdl",
	"models/ocrp2players/police/l1/male_09.mdl"
	},
	description = [[Patrol the city, and co-operate with your fellow officers and other government agencies to enforce the law.]],
	weapons = {"arrest_stick", "m9k_fists", "unarrest_stick", "bb_fiveseven_cop", "bb_m3_cop", "stunstick", "door_ram", "weaponchecker"},
	command = "cp",
	max = 7,
	salary = 130,
	PlayerSpawn = function(ply) ply:SetArmor(35) end,
	admin = 0,
	vote = true,
	hasLicense = true,
	ammo = {
		["pistol"] = 60,
		["smg1"] = 240,
		["buckshot"] = 48,
	}
})

TEAM_CHIEF = DarkRP.createJob("Police Chief", {
	color = Color(20, 20, 255, 255),
	model = {"models/ocrp2players/police/l1/male_01.mdl", 
	"models/ocrp2players/police/l1/female_01.mdl",
	"models/ocrp2players/police/l1/male_02.mdl", 
	"models/ocrp2players/police/l1/female_02.mdl",
	"models/ocrp2players/police/l1/male_03.mdl",
	"models/ocrp2players/police/l1/female_03.mdl",
	"models/ocrp2players/police/l1/male_04.mdl",
	"models/ocrp2players/police/l1/female_04.mdl",
	"models/ocrp2players/police/l1/male_05.mdl",
	"models/ocrp2players/police/l1/male_06.mdl",
	"models/ocrp2players/police/l1/female_06.mdl",
	"models/ocrp2players/police/l1/male_07.mdl",
	"models/ocrp2players/police/l1/female_07.mdl",
	"models/ocrp2players/police/l1/male_08.mdl",
	"models/ocrp2players/police/l1/male_09.mdl"
	},
	description = [[Lead the police force against crime. You take orders from nobody except the mayor.]],
	weapons = {"arrest_stick", "m9k_fists", "unarrest_stick", "bb_deagle_cop", "bb_m3_cop", "stunstick", "door_ram", "weaponchecker"},
	command = "chief",
	max = 1,
	salary = 170,
	admin = 0,
	vote = false,
	PlayerSpawn = function(ply) ply:SetArmor(75) end,
	hasLicense = true,
	chief = true,
	NeedToChangeFrom = TEAM_POLICE,
	ammo = {
		["pistol"] = 60,
		["smg1"] = 240,
		["buckshot"] = 48,
	}
})
TEAM_SWAT = DarkRP.createJob("SWAT", {
	color = Color(13, 13, 127, 127),
	model = {"models/ocrp2players/swat/10/male_01.mdl",
			"models/ocrp2players/swat/10/male_02.mdl",
			"models/ocrp2players/swat/10/male_03.mdl",
			"models/ocrp2players/swat/10/male_04.mdl",
			"models/ocrp2players/swat/10/male_05.mdl",
			"models/ocrp2players/swat/10/male_06.mdl",
			"models/ocrp2players/swat/10/male_07.mdl",
			"models/ocrp2players/swat/10/male_08.mdl",
			"models/ocrp2players/swat/10/male_09.mdl"},
	description = [[Assist the police force in highly dangerous missions. You are the worst nightmare of even the most experienced criminal.]],
	weapons = {"arrest_stick", "m9k_fists", "unarrest_stick", "bb_fiveseven_cop", "bb_mp5_cop", "stunstick", "door_ram", "weaponchecker"},
	command = "swat",
	max = 4,
	salary = 140,
	PlayerSpawn = function(ply) ply:SetArmor(100) end,
	admin = 0,
	vote = true,
	hasLicense = true,
		customCheck = function(ply) return CLIENT or
 		ply:IsUserGroup ("VIP") or 
		ply:IsUserGroup ("vip") or 
		ply:IsUserGroup ("donator") or 
		ply:IsUserGroup ("Donator") or
		ply:IsUserGroup("admin") or 
		ply:IsUserGroup("super-admin") or 
		ply:IsUserGroup("liaison") or 
		ply:IsUserGroup("council") or 
		ply:IsUserGroup("owner") or 
		ply:IsUserGroup("Moderator") or 
		ply:IsUserGroup("Admin") or 
		ply:IsUserGroup("moderator") or
		ply:IsUserGroup("Super-Admin") or 
		ply:IsUserGroup("superadmin") or 
		ply:IsUserGroup("Liaison") or 
		ply:IsUserGroup("Council")end,
				CustomCheckFailMsg = "This job requires VIP status.",
	ammo = {
		["pistol"] = 60,
		["smg1"] = 240,
		["buckshot"] = 48,
	}
})

TEAM_SWATCHIEF = DarkRP.createJob("SWAT Team Leader", {
	color = Color(13, 13, 127, 127),
	model = {"models/ocrp2players/swat/10/male_01.mdl",
			"models/ocrp2players/swat/10/male_02.mdl",
			"models/ocrp2players/swat/10/male_03.mdl",
			"models/ocrp2players/swat/10/male_04.mdl",
			"models/ocrp2players/swat/10/male_05.mdl",
			"models/ocrp2players/swat/10/male_06.mdl",
			"models/ocrp2players/swat/10/male_07.mdl",
			"models/ocrp2players/swat/10/male_08.mdl",
			"models/ocrp2players/swat/10/male_09.mdl"},
	description = [[Lead the SWAT Team against highly dangerous targets. You answer to the Police Chief and the Mayor.]],
	weapons = {"arrest_stick", "m9k_fists", "unarrest_stick", "bb_deagle_cop", "bb_sg552_cop", "bb_mp5_cop", "stunstick", "door_ram", "weaponchecker"},
	command = "swatchief",
	max = 1,
	salary = 160,
	PlayerSpawn = function(ply) ply:SetArmor(100) end,
	admin = 0,
	vote = true,
	hasLicense = true,
		customCheck = function(ply) return CLIENT or ply:IsUserGroup("moderator") or 
		ply:IsUserGroup ("VIP") or 
		ply:IsUserGroup ("vip") or 
		ply:IsUserGroup ("donator") or 
		ply:IsUserGroup ("Donator") or
		ply:IsUserGroup("admin") or 
		ply:IsUserGroup("moderator") or
		ply:IsUserGroup("super-admin") or 
		ply:IsUserGroup("liaison") or 
		ply:IsUserGroup("council") or 
		ply:IsUserGroup("owner")or 
		ply:IsUserGroup("Moderator") or 
		ply:IsUserGroup("Admin") or 
		ply:IsUserGroup("Super-Admin") or 
		ply:IsUserGroup("superadmin") or 
		ply:IsUserGroup("Liaison") or 
		ply:IsUserGroup("Council")end,
				CustomCheckFailMsg = "This job requires VIP status.",
	NeedToChangeFrom = TEAM_SWAT,
	ammo = {
		["pistol"] = 60,
		["smg1"] = 240,
		["buckshot"] = 48,
	}
})

TEAM_MAYOR = DarkRP.createJob("Mayor", {
	color = Color(150, 20, 20, 255),
	model = {"models/ocrp2players/mayor/10/male_01.mdl",
		"models/ocrp2players/mayor/10/female_01.mdl",
		"models/ocrp2players/mayor/10/male_02.mdl",
		"models/ocrp2players/mayor/10/female_02.mdl",
		"models/ocrp2players/mayor/10/male_03.mdl",
		"models/ocrp2players/mayor/10/female_03.mdl",
		"models/ocrp2players/mayor/10/male_04.mdl",
		"models/ocrp2players/mayor/10/female_04.mdl",
		"models/ocrp2players/mayor/10/male_05.mdl",
		"models/ocrp2players/mayor/10/male_06.mdl",
		"models/ocrp2players/mayor/10/female_06.mdl",
		"models/ocrp2players/mayor/10/male_07.mdl",
		"models/ocrp2players/mayor/10/female_07.mdl",
		"models/ocrp2players/mayor/10/male_08.mdl",
		"models/ocrp2players/mayor/10/male_09.mdl",},
	description = [[Do whatever you must to run the city smoothly. Direct the police force, and bring prosperity to EvoCity.]],
	weapons = {"m9k_fists"},
	command = "mayor",
	max = 1,
	salary = 175,
	PlayerSpawn = function(ply) ply:SetArmor(25) end,
	admin = 0,
	vote = true,
	hasLicense = false,
	mayor = true,
	PlayerDeath = function(ply, weapon, killer)
		ply:teamBan()
		ply:changeTeam(GAMEMODE.DefaultTeam, true)
		if killer:IsPlayer() then
			DarkRP.notifyAll(0, 4, "The mayor has been killed.")
		else
			DarkRP.notifyAll(0, 4, "The mayor has died.")
		end
	end
})

TEAM_SS = DarkRP.createJob("Secret Service", {
    color = Color(35, 63, 172, 255),
    model = {"models/ocrp2players/clothes5/10/male_01.mdl",
			"models/ocrp2players/clothes5/10/male_02.mdl",
			"models/ocrp2players/clothes5/10/male_03.mdl",
			"models/ocrp2players/clothes5/10/male_04.mdl",
			"models/ocrp2players/clothes5/10/male_05.mdl",
			"models/ocrp2players/clothes5/10/male_06.mdl",
			"models/ocrp2players/clothes5/10/male_07.mdl",
			"models/ocrp2players/clothes5/10/male_08.mdl",
			"models/ocrp2players/clothes5/10/male_09.mdl"},
    description = [[ Protect the mayor from threats. Co-ordinate with the police to ensure that he remains safe at all times.]],
    weapons = {"bb_fiveseven_ss", "bb_mac10_ss", "stunstick", "weaponchecker", "m9k_fists"},
    command = "ss",
    max = 5,
    salary = 140,
	PlayerSpawn = function(ply) ply:SetArmor(35) end,
    admin = 0,
    vote = true,
    hasLicense = true,
        ammo = {
        ["pistol"] = 60,
		["smg1"] = 240,
		["rifle"] = 240,
    }
})

TEAM_SSD = DarkRP.createJob("Secret Service Director", {
    color = Color(35, 63, 172, 255),
    model = {"models/ocrp2players/clothes5/10/male_01.mdl",
			"models/ocrp2players/clothes5/10/male_02.mdl",
			"models/ocrp2players/clothes5/10/male_03.mdl",
			"models/ocrp2players/clothes5/10/male_04.mdl",
			"models/ocrp2players/clothes5/10/male_05.mdl",
			"models/ocrp2players/clothes5/10/male_06.mdl",
			"models/ocrp2players/clothes5/10/male_07.mdl",
			"models/ocrp2players/clothes5/10/male_08.mdl",
			"models/ocrp2players/clothes5/10/male_09.mdl"},
	description = [[Lead the Secret Service team in protection of the mayor.]],
    weapons = {"bb_deagle_ss", "bb_mac10_ss", "bb_mp5_ss", "stunstick", "weaponchecker", "m9k_fists"},
    command = "ssd",
    max = 1,
    salary = 155,
	PlayerSpawn = function(ply) ply:SetArmor(50) end,
    admin = 0,
    vote = false,
	NeedToChangeFrom = TEAM_SS,
    hasLicense = true,
        ammo = {
        ["pistol"] = 60,
		["smg1"] = 240,
		["rifle"] = 240,
    }
})

TEAM_PMED = DarkRP.createJob("Paramedic", {
    color = Color(244, 78, 255, 255),
    model = {"models/ocrp2players/paramedic/10/male_01.mdl",
			"models/ocrp2players/paramedic/10/female_01.mdl",
			"models/ocrp2players/paramedic/10/male_02.mdl",
			"models/ocrp2players/paramedic/10/female_02.mdl",
			"models/ocrp2players/paramedic/10/male_03.mdl",
			"models/ocrp2players/paramedic/10/female_03.mdl",
			"models/ocrp2players/paramedic/10/male_04.mdl",
			"models/ocrp2players/paramedic/10/female_04.mdl",
			"models/ocrp2players/paramedic/10/male_05.mdl",
			"models/ocrp2players/paramedic/10/male_06.mdl",
			"models/ocrp2players/paramedic/10/female_06.mdl",
			"models/ocrp2players/paramedic/10/male_07.mdl",
			"models/ocrp2players/paramedic/10/female_07.mdl",
			"models/ocrp2players/paramedic/10/male_08.mdl",
			"models/ocrp2players/paramedic/10/male_09.mdl"
			},
    description = [[Respond to medical emergencies and save lives.]],
    weapons = {"m9k_fists", "darkrp_defibrillator", "med_kit"},
    command = "paramedic",
    max = 4,
    salary = 140,
    admin = 0,
    vote = false,
    hasLicense = false,
})

TEAM_FIRE = DarkRP.createJob("Firefighter", {
    color = Color(245, 190, 10, 255),
    model = {"models/ocrp2players/firefighter/10/male_01.mdl",
		"models/ocrp2players/firefighter/10/female_01.mdl",
		"models/ocrp2players/firefighter/10/male_02.mdl",
		"models/ocrp2players/firefighter/10/female_02.mdl",
		"models/ocrp2players/firefighter/10/male_03.mdl",
		"models/ocrp2players/firefighter/10/female_03.mdl",
		"models/ocrp2players/firefighter/10/male_04.mdl",
		"models/ocrp2players/firefighter/10/female_04.mdl",
		"models/ocrp2players/firefighter/10/male_05.mdl",
		"models/ocrp2players/firefighter/10/male_06.mdl",
		"models/ocrp2players/firefighter/10/female_06.mdl",
		"models/ocrp2players/firefighter/10/male_07.mdl",
		"models/ocrp2players/firefighter/10/female_07.mdl",
		"models/ocrp2players/firefighter/10/male_08.mdl",
		"models/ocrp2players/firefighter/10/male_09.mdl"},
    description = [[Extinguish fires, and save the citizens of EvoCity from burning vehicles and buildings. Occasionally, help a cat out of a tree.]],
    weapons = {"m9k_fists"},
    command = "firefighter",
    max = 4,
    salary = 140,
    admin = 0,
    vote = false,
    hasLicense = false,
})

TEAM_MOB = DarkRP.createJob("Mob Boss", {
	color = Color(25, 25, 25, 255),
	model = "models/player/gman_high.mdl",
	description = [[Lead your family to prosperity.]],
	weapons = {"lockpick", "unarrest_stick", "m9k_fists"},
	command = "mobboss",
	max = 1,
	salary = 150,
	admin = 0,
	vote = false,
	hasLicense = false,
	PlayerDeath = function(ply, weapon, killer)
		ply:teamBan()
		ply:changeTeam(GAMEMODE.DefaultTeam, true)
		if killer:IsPlayer() then
			DarkRP.notifyAll(0, 4, "The mob boss has been killed.")
		else
			DarkRP.notifyAll(0, 4, "The mob boss has died.")
		end
	end
})

TEAM_HITMAN = DarkRP.createJob("Contract Killer", {
    color = Color(18, 91, 25, 255),
    model = "models/player/phoenix.mdl",
    description = [[Do what others wouldn't dare to do. You are the cleanup crew, and handle jobs for those who don't want to get their hands dirty.]],
    weapons = {"bb_scout_ck", "m9k_fists"},
    command = "hitman",
    max = 2,
    salary = 120,
    admin = 0,
    vote = true,
    hasLicense = false,
		ammo = {
		["smg1"] = 180,
		["rifle"] = 180,
	}
})

TEAM_GUARD = DarkRP.createJob("Private Security", {
    color = Color(228, 165, 18, 255),
    model = "models/player/odessa.mdl",
    description = [[Contracted security. Defend your client and their property with your life.]],
    weapons = {"bb_p228_ps", "weaponchecker", "m9k_fists"},
    command = "guard",
    max = 4,
    salary = 120,
	PlayerSpawn = function(ply) ply:SetArmor(25) end,
    admin = 0,
    vote = false,
    hasLicense = true,
		ammo = {
		["pistol"] = 60,
	}
})

TEAM_THIEF = DarkRP.createJob("Thief", {
    color = Color(158, 157, 154, 255),
    model = "models/player/arctic.mdl",
    description = [[Break into properties, and steal valuables.]],
    weapons = {"lockpick", "keypadcracker", "m9k_fists"}, -- You may wanna find a pickpocket swep and add it here.
    command = "thief",
    max = 5,
    salary = 120,
    admin = 0,
    vote = false,
    hasLicense = false,
})


TEAM_ADMIN = DarkRP.createJob("Staff On Duty", {
    color = Color(255, 255, 255, 0),
    model = "models/player/combine_super_soldier.mdl",
    description = [[A member of the QIG CasualRP Staff.]],
    weapons = {"m9k_fists", "adminstick"},
    command = "aod",
    max = 0,
	PlayerSpawn = function(ply) ply:SetArmor(100) end,
    salary = GAMEMODE.Config.normalsalary * 1.2,
    admin = 0,
    vote = false,
    hasLicense = true,
				customCheck = function(ply) return CLIENT or ply:IsUserGroup("admin") or 
		ply:IsUserGroup("super-admin") or 
		ply:IsUserGroup("liaison") or 
		ply:IsUserGroup("council") or 
		ply:IsUserGroup("owner")or 
		ply:IsUserGroup("Moderator") or 
		ply:IsUserGroup("Admin") or 
		ply:IsUserGroup("moderator") or
		ply:IsUserGroup("Super-Admin") or 
		ply:IsUserGroup("superadmin") or 
		ply:IsUserGroup("Liaison") or 
		ply:IsUserGroup("Council")end,
				CustomCheckFailMsg = "This job requires staff status.",
})

--[[---------------------------------------------------------------------------
Define which team joining players spawn into and what team you change to if demoted
---------------------------------------------------------------------------]]
GAMEMODE.DefaultTeam = TEAM_CITIZEN


--[[---------------------------------------------------------------------------
Define which teams belong to civil protection
Civil protection can set warrants, make people wanted and do some other police related things
---------------------------------------------------------------------------]]
GAMEMODE.CivilProtection = {
	[TEAM_POLICE] = true,
	[TEAM_CHIEF] = true,
	[TEAM_MAYOR] = true,
	[TEAM_SWAT]  = true,
	[TEAM_SWATCHIEF] = true,
}

--[[---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------]]
DarkRP.addHitmanTeam(TEAM_HITMAN)


[editline]2nd April 2015[/editline]

EDIT: Fixed with


 PlayerLoadout = function(ply) ply:SetArmor(AMOUNT) end