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 )
end

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

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


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 http://wiki.garrysmod.com/page/GM/CanPlayerSuicide

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

No.

Okay thank you very much :stuck_out_tongue: