Showing a Derma Menu with a Chat Command

Hi,

I have my Derma Menu here :


	
	local MidW, MidH = ScrW() / 2, ScrH() / 2

	local function DescMenu( )
		local DermaPanel = vgui.Create( "DFrame" )
		Derma:SetSize( 300, 100 )
		Derma:SetPos( midW - ( Derma:GetWide() / 2 ), midH - ( Derma:GetTall() / 2) )
		Derma:SetTitle( "Kill yourself" )
		Derma:SetDraggable( false )
		Derma:MakePopup() 

		local DermaClose = vgui.Create( "DButton", DermaPanel )
		DermaClose:SetPos( 150, 50 )
		DermaClose:SetText( "CLICK TO DIE" )
		DermaClose:SetSize( 120, 60 )
		DermaClose.DoClick = function()
			RunConsoleCommand( "kill" )
		end	
	end


and I’m trying to open it with a command like “/openderma” or something like that.

I’ve tried all of the solutions on facepunch, not working, concommands, not working.

When i type the command and press entre, he does simply nothing, no error.

I really need help on this one

Thanks,

Benji

Clientside

Serverside

If you’re using the serverside hook you’ll need to learn networking

It’s working ! Thank you !

Benji
[/QUOTE]

Quick tip:

You can just use


Derma:Center()

instead of


Derma:SetPos( midW - ( Derma:GetWide() / 2 ), midH - ( Derma:GetTall() / 2) )