You have done the if statement wrong, to check if something is equal to something else in an if statement you need to use == rather than = as using a single equals sign tells it you are setting data rather than checking data.
In terms of working out how many people are doing the job you currently are doing nothing to tell the code to count the number of people on a team, gmod has a function for that; https://wiki.facepunch.com/gmod/team.NumPlayers
It is hard to say exactly how to fix your code as you have not provided much detail such as where pl is coming from but that is not too important, the way I would do this is;
if team.NumPlayers(TEAM_DEALER) > 0 then
chat.AddText(Color(255, 0, 0), "Someone is doing Weapon Dealer job you cant use the npc.Go and buy on weapon dealer!!")
return
end
Also, you should learn to use prints to debug, using a print and checking console can help show how far the code is getting and can help show where the issue is.
(I know this post is old but more responding to help anyone with the same type of issue)