DButton/SetConsoleCommand

From Garry's Mod
Jump to: navigation, search
 DButton:SetConsoleCommand( )

Contents

DescriptionPanelFunc

Sets a console command to be called when the button is clicked.

This overrides the button's DoClick method.

Arguments

string command

The console command to be called.

Arguments

string args

The arguments for the command.

Examples

Example

Creates a button that makes the player say their name.

local button = vgui.Create( "DButton" )
button:SetSize( 100, 35 )
button:SetText( "Say your nickname" )
button:Center()
button:MakePopup()
button:SetConsoleCommand( "say", LocalPlayer():Nick() )


Personal tools
Navigation