Darkrp pulling category info and checking if a job is in a category

To start off with. Probably not good i look into code at 1130pm after a full days work. But ive been trying to check two tables against each other to determine if players current team’s job info is within a certain category.

All of this is to achieve a colored agenda suited to the categories color. Eg civil protection, gangsters.

I have no idea if im going about this completely wrong. Ive just been testing a heap of crap. Ive pulles data from one category to color an agenda. But it isnt the one the localplayer is in.