how do I Make a Button On a Derma that will run a concommand
Overwrite the DoClick function on the DButton.
It can be done one of two ways:
[lua]function vgui_dbutton:DoClick( input )
RunConsoleCommand( "command", "arg1", "arg2" );
end[/lua]
or
[lua]vgui_dbutton.DoClick = function( self, input )
RunConsoleCommand( "command", "arg1", "arg2" );
end[/lua]
Put that in your Panel:Init( ) which creates the button, change vgui_dbutton to the variable the vgui.Create is assigned to.
ok Thanks for your Help!
Sorry, you need to Log In to post a reply to this thread.