Adding command to scoreboard

So I’m editing the admin_buttons.lua file, and I tried to add this there:


/*   GotoPlayer */

PANEL = {}
PANEL.Text = "Goto"
/*---------------------------------------------------------
   Name: DoCommand
---------------------------------------------------------*/
function PANEL:DoCommand( ply )

	RunConsoleCommand( "ulx goto", ply:UserID() )

end;

vgui.Register( "PlayerBanButton", PANEL, "SpawnMenuAdminButton" )

So I’m trying to make it when you click on the players name and click on “Goto” button it would use ulx goto command to go to the player, but it just seems not to work.
How can I do it so it’ll work?

Try this
RunConsoleCommand( "ulx goto " … ply:UserID() )

[lua]/* GotoPlayer */

PANEL = {}
PANEL.Text = “Goto”
/---------------------------------------------------------
Name: DoCommand
---------------------------------------------------------
/
function PANEL:DoCommand( ply )

RunConsoleCommand( "ulx", "goto", ply:UserID() )

end;

vgui.Register( “PlayerBanButton”, PANEL, “SpawnMenuAdminButton” )[/lua]

There you go :smile:

You do realize this will cause conflicts with the ban button?

I did found out that it does. Anyway, the ban button there just bans the player for permanently or for 1 hour, and adds no reason to it.