How to block console commands?

Hi,
im looking for help :slight_smile: I want block some console commands, for example “kill” becasue its really annoying in RP.
Thx

Well to disable player to use kill in console put this in init.lua



function GM:CanPlayerSuicide()
	return false; --False for no suicide, True for you can suicide!
end


For the command kill just use **[Gamemode.CanPlayerSuicide

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.CanPlayerSuicide)** , no need to disable the command itself.

Also for admins able to suicide you can use this in the gamemode.
[lua]function GM:CanPlayerSuicide(ply)
return ply:IsAdmin()
end
[/lua]
or this in a seperate lua file
[lua]hook.Add(“CanPlayerSuicide”, “NoSuicide4u”, function(ply)
return ply:IsAdmin()
end)
[/lua]

Thx for both help :slight_smile: