• Adding command to scoreboard
    4 replies, posted
So I'm editing the admin_buttons.lua file, and I tried to add this there: [code]/* GotoPlayer */ PANEL = {} PANEL.Text = "Goto" /*--------------------------------------------------------- Name: DoCommand ---------------------------------------------------------*/ function PANEL:DoCommand( ply ) RunConsoleCommand( "ulx goto", ply:UserID() ) end; vgui.Register( "PlayerBanButton", PANEL, "SpawnMenuAdminButton" )[/code] 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:
[QUOTE=iRzilla;18683690]You do realize this will cause conflicts with the ban button?[/QUOTE] 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.
Sorry, you need to Log In to post a reply to this thread.