Soo I’ve been adjudicated mentally ill..

I’m not sure how I lost my gun rights because both of my hospitalizations (2 in 6 months) when I was 21 were voluntary. (So say I get that reversed) and If my diagnosis was cannabis induced psychosis and I’ve not smoked any cannabis for 3-5 years without any problems, do I have any chance at all at becoming a police officer? Has anyone ever heard of an officer that’s been checked into a mental hospital before?