[SEARCHING] 911 script for officers to see not whole server

Hello all I have searched and searched and tested many 911 scripts but I cannot find a 911 script that only shows the 911 call to officers on duty. I have found the badgers 911 script but it doesn’t display calls in chat to cops only shows in discord channel you created the webhook for. I tested faxes but his way of doing it to cops only is by ped codes, I use EUP making that not doable. I have looked and looked and can’t find anything else. I am running Vmenu server and we are launched in BETA for testing

RegisterCommand('911', function (source, args)
    for _, players in pairs(GetPlayers()) do
        if IsPlayerAceAllowed(players, 'police') then
            TriggerClientEvent('chat:addMessage', players, { color = {255, 0, 0}, multiline = false, args = {'911', table.concat(args, " ")}})
        end
    end
end, false)

Here is a very basic example of what I think you’re looking for? Whenever the 911 command is entered it will loop through all players on the server then check if they have the ace perm ‘police’ if they do then it will send a chat message with the contents of the 911 call only to them.

is this able to be put into any script. (I’m really new I’m learning as I’m deving) and where it says ‘Police’ am I allowed to put more than one role or while I have to create a general discord role and assign it to all police for this?
and thank you so much for responding

Yes, it’s a server side script. You’d have to do another check like IsPlayerAceAllowed(players, ‘otherrole’) below the first if statement but I should mention isn’t discord based at all it uses the built in ace permissions system you can learn more about that here.

thank you very much for this

Hello Outcast_Designs2020,
I have just recently created a script which does exactly what you are wanting plus more

Here is the link: