[Request] A 'gag' script that allows you to stop someone speaking

On our RP server, one of the biggest issues our cops have is that players tend to abuse them when being arrest and scream at them which makes it not fun for them.

I would love a ‘gag’ script that stops people speaking while it is enabled.

So a script to not allow people to speak?

Maybe an annimation that puts them in a choke hold?

Yeah basically but I’d really like it to be an item that cops can use. Or anything really. I don’t care how it is done, I just want it so cops only can use it.

I’m using esx_policejob so if someone could help me with code that would add a ‘gag’ option to the police menu that works in the exact same way the ‘handcuff’ option works that would be amazing.

Anyone interested in helping write this?

Well, I made one a while back that disables voice usage for a specified user but, it’s tied up with a bunch of other stuff.

What code was it tied to? :o

My framework in the admin files.

I’ll try to dig it up.

So far, got one for chat :confused:
Not really what you’re looking for but, I know I have a voice mute (i think). This has dependencies (Essentialsmode as well as other stuff that isn’t released) and exports that I wont provide as 1. I’m too lazy since it’s too much to search and 2. I don’t want to give too much away.

Server.lua

TriggerEvent("es:addCommand", "mute", function(source, args, user)
  local src = source
  local adminids = {}
  
  TriggerEvent("---:getAdminIds", function(ids)
    adminids = ids
  end)
  
  if (user.get("isadmin") or user.get("ismod")) then
    local id = tonumber(args[2])
    local mute = tonumber(args[3])
    
    if (id) then
      if (mute) then
        TriggerEvent("es:getPlayerFromId", id, function(ruser)
          TriggerClientEvent("---:chat:setChatMute", id, mute)
          
          local mutestr = "^1MUTED^0"
          
          if (mute == 0) then
            mutestr = "^2UNMUTED^0"
          end
          
          for _,v in pairs(adminids) do
            TriggerClientEvent("chatMessage", v, "SERVER", {255, 0, 0}, string.format("Chat mute set to %s for %s (%s) by %s", mutestr, ruser.get("activeChar"), GetPlayerName(id), user.get("activeChar")))
          end
        end)
      else
        TriggerClientEvent("chatMessage", src, "ADMIN", {0, 255, 0}, "Usage: /mute [id] [0:1]")
      end
    else
      TriggerClientEvent("chatMessage", src, "ADMIN", {0, 255, 0}, "Usage: /mute [id] [0:1]")
    end
    
  end
end)

I can start writing this u if you want. For voice chat.

1 Like

I would be super appreciative. If I do it it’s legit gonna take me 10 hours. I’m still learning.

1 Like

I start it when home in just under an hour

1 Like

My hero.

1 Like

It will most likely be a chat command but better then nothing

1 Like

Hey man as long as it stops these trolls from being able to scream into their mics at our cops I’ll be stoked! Possible to limit it to the ‘police’ and ‘ambulance’ jobs?

1 Like

Jobs via a framework, I wont do as I don’t work with frameworks, but it will have a ped whitelist…

Ahh okay I’ll do my best.

1 Like

About to release for ya :stuck_out_tongue:

1 Like

done her :stuck_out_tongue:

1 Like