Discord
Steam
/
Garry's Mod
/
Developers
/
When I select ..
Login/Join
Event Log
When I select multiple checkbox I got ClassName
1 replies, posted
Search
In This Thread
When I select just 1 Checkbox from my weapons table I have ex:(CROSSBOW) but when I select 2 and more I got [CODE] #HL2_Pistol #HL2_Crossbow[/CODE] Any one know what wrong ? [LUA]if CLIENT then function DCustomAmmoMenu() test_table = {} local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50,50 ) DermaPanel:SetSize( 305, 305 ) DermaPanel:SetTitle( " Weapons Factory Editor " ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() local DermaListView = vgui.Create("DListView") DermaListView:SetParent(DermaPanel) DermaListView:SetPos(183, 70) DermaListView:SetSize(110, 185) DermaListView:SetMultiSelect(false) DermaListView:AddColumn("Weapons Selected") -- Add column local bShow = vgui.Create( "DButton", DermaPanel ) bShow:SetSize( 60, 23 ) bShow:SetPos( 207, 36 ) bShow:SetText( "Show" ) local bClear = vgui.Create( "DButton", DermaPanel ) bClear:SetSize( 60, 23 ) bClear:SetPos( 207, 267 ) bClear:SetText( "Clear" ) bClear.DoClick = function( bClear ) table.Empty(test_table) end local DermaCheckBox = vgui.Create( "DPanelList", DermaPanel ) DermaCheckBox:SetPos( 22,35 ) DermaCheckBox:SetSize( 150, 255 ) DermaCheckBox:SetSpacing( 5 ) DermaCheckBox:SetPadding( 5 ) DermaCheckBox:EnableHorizontal( false ) DermaCheckBox:EnableVerticalScrollbar( true ) for k, v in pairs(LocalPlayer():GetWeapons()) do local WepListCBox = vgui.Create( "DCheckBoxLabel" ) WepListCBox:SetText( v:GetPrintName() .. WepListCBox:GetValue() ) WepListCBox:SetValue( 0 ) WepListCBox:SizeToContents() DermaCheckBox:AddItem( WepListCBox ) WepListCBox.OnChange = function() if WepListCBox:GetChecked(true) then surface.PlaySound( "buttons/button9.wav" ) table.insert (test_table, "" ..v:GetPrintName() .. WepListCBox:GetValue() .. "\n" ) else surface.PlaySound( "buttons/button14.wav" ) table.remove (test_table, tonumber("" ..v:GetPrintName() ..WepListCBox:GetValue().. "\n") ) end bShow.DoClick = function( bShow ) if (table.getn(test_table)) == 0 then GAMEMODE:AddNotify(" | -- EMPTY -- | ", NOTIFY_GENERIC, 2); surface.PlaySound( "buttons/button16.wav" ) end LocalPlayer():PrintMessage( HUD_PRINTTALK, tostring(table.concat(test_table) )) end end end end concommand.Add("DCustomAM",DCustomAmmoMenu) end[/LUA]
-snip-
Sorry, you need to
Log In
to post a reply to this thread.