Normal users unable to join jobs that require Voting

Hello, I am trying to setup a DarkRP server and whenever normal users try to join a job that requires a server vote, such as SWAT Marksman, they are unable to start a vote and get the message “You are unable to start a vote”. If anyone could give me some feedback on how to fix this, it would be amazing!

Here is the SWAT Marksman job code:


TEAM_MSWAT = DarkRP.createJob("SWAT Marksman", {
   color = Color(12, 83, 221, 255),
   model = {"models/player/combine_soldier04.mdl"},
   description = [[The SWAT Team's Marksman]],
   weapons = {"arrest_stick", "unarrest_stick", "weapon_pepperspray", "m9k_m92beretta", "stunstick", "door_ram", "weaponchecker", "m9k_intervention"},
   command = "mswat",
   if ply:Team() == "MSWAT" then ply:SetArmor( 250 ),
   max = 2,
   salary = 125,
   vote = true,
   admin = 0,
   hasLicense = true,
   candemote = false,
   customCheck = function(ply) return CLIENT or
   table.HasValue({"vip", "moderator+", "admin+", "superadmin", "co-owner", "owner"}, ply:GetNWString("usergroup"))
   end,
   CustomCheckFailMsg = "This job is for VIP Only",
   category = "Civil Protection",
   customCheck = function(ply) return CLIENT or ply:HasPassedCpForm() end,
   CustomCheckFailMsg = "You did not pass the cp test!"
})
 

[editline]8th July 2015[/editline]

I am also now getting this error in my console when I join the server:

[lua]
if ply:Team() == “MSWAT” then ply:SetArmor( 250 ),
[/lua]

This is probably what’s messing it up. You are missing an “end”, but even then, “ply” is undefined.

You can’t have multiple customChecks like that. You need to fit it in one function. Also, I think there needs to be a specific variable for vote jobs.

How do I do that? I got these codes from addons and help pages and i’m fairly new to Lua

HasPassedCpForm() ???

[editline]11th July 2015[/editline]

Where did you get that from