Alright, I'm very frustrated, and annoyed at this. About once a month, I come back to lua, and try for about two days, then I get frustrated because the wikis really suck, and then I just get annoyed, and quit again. I'm done quitting, and I need assistance on this.
Alright, I'm trying to make it so that I can select a name from DListView, and then when I press a button, it takes the name( or unique ID, i don't care) of that selected person, and sends it through a console command... that's all I want, but I just can't find out how to do this for the love of my life. I'm quit annoyed right now, so please excuse my terrible punctuation.
This is what I have so far.
GetGiveMoneyPlayers = vgui.Create("DListView", TabThree )
GetGiveMoneyPlayers:SetPos(273, 75)
GetGiveMoneyPlayers:SetSize(300, 175)
GetGiveMoneyPlayers:SetMultiSelect(false)
GetGiveMoneyPlayers:AddColumn("Name")
GetGiveMoneyPlayers:AddColumn("Points")
for k,v in pairs(player.GetAll()) do
GetGiveMoneyPlayers:AddLine(v:Nick(),v:GetPData('MyXPPoints'))
end
GiveMoneyBox = vgui.Create( "DTextEntry", TabThree)
GiveMoneyBox:SetPos( 348,50 )
GiveMoneyBox:SetTall( 25 )
GiveMoneyBox:SetWide( 75 )
GiveMoneyBox:SetEnterAllowed( true )
GiveMoneyBox:SetValue(100)
MoneyButton = vgui.Create( "DButton", TabThree )
MoneyButton:SetSize( 72, 25 )
MoneyButton:SetPos( 88, 70 )
MoneyButton:SetPos( 273, 50 )
MoneyButton:SetText( "Give Money" )
MoneyButton.DoClick = function()
-- MsgN(GetGiveMoneyPlayers:GetSelectedLine())
PrintTable(GetGiveMoneyPlayers:GetSelected(GetGiveMoneyPlayers:GetSelectedLine()))
-- RunConsoleCommand( "TDMGiveMoney", GetGiveMoneyPlayers:GetSelected(), GiveMoneyBox:GetValue() )
--PrintTable(GetGiveMoneyPlayers:GetSelected():GetValue(1))
--MsgN(GetGiveMoneyPlayers:GetSelected():GetValue(1))
end