Darkrp Jobs Spawning With Armor.

Hey, I was wondering if anyone knew how to make it so something like a “Juggernaut” job spawns with extra armor for Darkrp.

Thanks

if ply:Team() == “Juggernaut” then ply:SetArmor( 100 ) ???

Sorry I’m a pretty big noob. Were would I put this?

under the job, garrysmod/darkrp/gamemode/shared.lua under the right job.

Here’s what my job code looks like now


})TEAM_JUGG = AddExtraTeam("Juggernaut", {
	color = Color(51, 0, 153, 150),
	model = "models/juggernaut_player.mdl",
	description = [[<VIP ONLY>
	The Juggernaut is just a general badass guy
	who solves his problems head on. 
	You help the cops by running in, taking hits, and
	mowing everyone down!]],
	weapons = {"unarrest_stick", "arrest_stick" , "weapon_mad_m249", "stunstick", "door_ram", "weaponchecker" , "weapon_real_cs_flash" , "weapon_mad_grenade" , "weapon_mad_deagle" , "weapon_radar"},
	command = "jugger",
	max = 2,
	salary = 90,
	admin = 0,
	vote = false,
	hasLicense = true,
	NeedToChangeFrom = TEAM_POLICE,
	if ply:Team() == JUGG then ply:SetArmor( 100 ))}

And I get this error


[ERROR] gamemodes/darkrp/gamemode/shared.lua:558: unexpected symbol near 'if'
  1. unknown - gamemodes/darkrp/gamemode/shared.lua:0

I tried moving around that code, but still end up getting errors.
Sorry for me being crappy at this. :confused:

[lua]TEAM_JUGG = AddExtraTeam(“Juggernaut”, {
color = Color(51, 0, 153, 150),
model = “models/juggernaut_player.mdl”,
description = [[<VIP ONLY>
The Juggernaut is just a general badass guy
who solves his problems head on.
You help the cops by running in, taking hits, and
mowing everyone down!]],
weapons = {“unarrest_stick”, “arrest_stick” , “weapon_mad_m249”, “stunstick”, “door_ram”, “weaponchecker” , “weapon_real_cs_flash” , “weapon_mad_grenade” , “weapon_mad_deagle” , “weapon_radar”},
command = “jugger”,
max = 2,
salary = 90,
admin = 0,
vote = false,
hasLicense = true,
NeedToChangeFrom = TEAM_POLICE,
customCheck = function(ply)
return ply:Team() == JUGG then ply:SetArmor(100))}
end[/lua]

that should work

(Just a question) but would it work?
I’m pretty sure the customCheck is being runned every time the F4 menu is being opened?
If that’s the case, he can re-open the F4 menu to refill Armor and the player will only get Armor when he opens the menu.

how could i do this with giving a job an ammo e.g. give police a siminov ammo


(User was banned for this post ("dumb bump" - postal))

This guy is a pro lua king lads

Dat bump + make a new thread, this has already been solved.