• Help with DListView
    1 replies, posted
I am making a bail addon and need to know how to get the person the player selected to get unarrested. Any help would be nice. [CODE]function BailMain() panel = vgui.Create("DFrame") panel:SetPos(ScrW()/2, ScrH()/4) panel:SetSize( 500, 700 ) panel:SetTitle( "Bail Machine" ) panel:SetVisible( true ) panel:SetDraggable( true ) panel:ShowCloseButton( true ) panel:MakePopup() arrested = vgui.Create("DListView", panel) arrested:SetPos(25, 50) arrested:SetSize( 450, 600) arrested:SetMultiSelect( false ) arrested:AddColumn("Name") for k, v in pairs(player.GetAll()) do if v:isArrested() == true then arrested:AddLine(v:Nick()) end end local unarrest = vgui.Create( "DButton", panel ) unarrest:SetText( "Unarrest This Player" ) unarrest:SetPos( 40, 660 ) unarrest:SetSize( 425, 30 ) unarrest.DoClick = function() RunConsoleCommand( "rp_unarrest ".. NEED HELP WITH THIS PART!!!) end end[/CODE] [highlight](User was banned for this post ("undescriptive thread title" - Gran PC))[/highlight]
local line = arrested:GetLine( arrested:GetSelectedLine() ) RunConsoleCommand( "rp_unarrest", line:GetValue(1)) try that
Sorry, you need to Log In to post a reply to this thread.