I need to know how to make a derma menu clickable for instance.
Erm
[lua]
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 500, 700 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local DermaListView = vgui.Create("DListView")
DermaListView:SetParent(DermaPanel)
DermaListView:SetPos(25, 50)
DermaListView:SetSize(450, 625)
DermaListView:SetMultiSelect(false)
DermaListView:AddColumn("Name") -- Add column
DermaListView:AddColumn("Amount of kills")
for k,v in pairs(player.GetAll()) do
DermaListView:AddLine(v:Nick(),v:Frags()) -- Add lines
end
[/lua]
That but, when I click on there name, it kicks the player I click or something.
Your thread name, your question and your code have nothing todo with each other...
[QUOTE=Wizard of Ass;32558245]Your thread name, your question and your code have nothing todo with each other...[/QUOTE]
Can you help?
I want it to make it so that when I click it it runs ply:Kick or something along them lines.
Just anything that will kick the player when I click them.
You would need to send a concommand and then the server needs to check if the player is allowed to run the command THEN kick the player.
[QUOTE=Wizard of Ass;32558522]You would need to send a concommand and then the server needs to check if the player is allowed to run the command THEN kick the player.[/QUOTE]
I dont care who runs it, that, doesnt matter.
What DOES it that it can kick them, I will expand from that myself.
Only the server can kick players, the things I said still apply.
RIGHT, Whatever.
Some code that allows me to use THEIR name in a concommand, NOT A KICKING CONCOMMAND.
Just running a concommand, thats all, using their name...
for instance
If I clicked on me, it would run "lolcommand tazy4tazy" or something/
[url]http://wiki.garrysmod.com/?title=DListView.OnRowSelected[/url]
or
[url]http://wiki.garrysmod.com/?title=DListView.DoDoubleClick[/url]
If you want it to be a double-click then something like this
[lua]
DermaListView.DoDoubleClick = function( panel, index, line )
RunConsoleCommand("lolcommand", line:GetSelectedLine())
end
[/lua]
[QUOTE=Derek_SM;32559068][url]http://wiki.garrysmod.com/?title=DListView.OnRowSelected[/url]
or
[url]http://wiki.garrysmod.com/?title=DListView.DoDoubleClick[/url]
If you want it to be a double-click then something like this
[lua]
DermaListView.DoDoubleClick = function( panel, index, line )
RunConsoleCommand("lolcommand", line:GetSelectedLine())
end
[/lua][/QUOTE]
YES!
IT WORKS!
I was actually doing this for when you click it it makes a Lua script run, so erm
If I put FScript.Name = "EpicHUD" at the top, how would I make another column that displayers FScript.Name for all of the scripts?
[QUOTE=tazy4tazy;32559591]YES!
IT WORKS!
I was actually doing this for when you click it it makes a Lua script run, so erm
If I put FScript.Name = "EpicHUD" at the top, how would I make another column that displayers FScript.Name for all of the scripts?[/QUOTE]Just run [b][url=http://wiki.garrysmod.com/?title=DListView.AddColumn]DListView.AddColumn [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] a second time to add another column. Then when adding lines you just add what contents in a second parameter. For example:
[lua]
local DermaListView = vgui.Create("DListView")
DermaListView:SetPos( 25, 50 )
DermaListView:SetSize( 500, 500 )
DermaListView:SetMultiSelect( false )
DermaListView:AddColumn( "Column 1" )
DermaListView:AddColumn( "Column 2" )
DListView:AddLine( "Column 1", "Column 2" )[/lua]
Run the console command "kick <ply_nick>" ?
Sorry, you need to Log In to post a reply to this thread.