There is the issue of discharging a firearm in a city, and there is the separate issue of killing a coyote.
Technically, firing even a BB gun in most large cities (outside of a designated facility) may violate some firearms ordinance. I looked up the rules in Portland and even a paintball gun is illegal, because the law includes projectiles propelled by compressed air or springs or elastic.
As for killing coyotes, you'd have to check your local ordinances. Around here, people wail about how it is "their natural habitat" and whatnot, like there isn't 98% of the state that is available for coyotes to roam.
https://www.sandiegouniontribune.com/news/environment/sdut-environment-coyote-nuisance-wildlife-trapping-2015feb06-htmlstory.html
Personally, I'd shoot them with an actual gun if I could get away with it.