How to get online state of cops?

cops

#1

Am trying to do a check were it will scan online for any current online cops or ems so on but not found anything am wondering if anyone has done this before and can help?

sample idea

if cop == ‘online’ then
// cops found
else
// no cops found

thanks


#2

How are you storing data that someone is actually a cop?
You could for example store that server side and assigning it when someone joins/leaves server and in this case if he is a cop…


#3

is it not possible just to look the connections already connected and pull of there job tag and if cop is found on any of them its counted ?


#4

But how do you assign a job to a player…?
There could be many meanings to that.


#5

my idea was use GetPlayers and loop the database to find all the cops that are in data then filter only the active police officers by using NetworkIsPlayerActive(id) this is all in my mind not yet really coded it just want to know if it possible ?