GMOD: Temporarily disable concommand

With such little information I don’t expect any exact examples but is there a way to disable normal concommands during events like

local event = false

function SWEP:PrimaryFire()
  event = true
  timer.Simple( 5, function() event = false end )

function SWEP:Think()
  if event == true then
    con.Command:Disable( "kill" ) --Probably wouldn't work, I just made this up for example

  if self.Owner:runConCommand( "kill" ) then --Again, made up garbage
    print( "YOU CAN'T DIE!!" )

I’m not sure if there is a function like that, that can disable a console command temporarily. Thanks.

You can’t block normal concommands, but you can block kill concommand with

Oh jeez thanks! Is there a function is called when the player runs a certain command?


Okay thank you very much :stuck_out_tongue: