How to check if a player is a certain job?

What would be the code to check a players job?

Like if I want to check if they are police. What would replace GetJob?

If LocalPlayer():GetJob == "TEAM_POLICE" then

A great way to do this to make a table then call if the table has a name (this is my fav way)

jobs =
“Civil Protection”,
“Mayor” – NO ,

if table.HasValue( jobs, team.GetName( ply:Team() ) ) then

[lua]if LocalPlayer():Team() == TEAM_POLICE then[/lua]