Run Command (DListView)



// RP Dox V3
chat.AddText(Color(0,255,255), "HHD: " , Color(0, 255, 0), "RP Dox V3 loaded")
chat.AddText(Color(0,255,255), "HHD: ", Color(0, 255, 0), "Use RPDoxMenu to open the window. Click a player's name and press the button.")
/*
START MENU
*/
function RPDoxMenuV3()

	local Menyoo = vgui.Create("DFrame")
	Menyoo:SetSize(500,350)
	Menyoo:MakePopup()
	Menyoo:SetTitle("RP DoxMenu Version 3")
	Menyoo:Center()
	Menyoo:SetKeyBoardInputEnabled()
	
	local plyrz = vgui.Create("DListView", Menyoo)
	plyrz:SetSize(200, Menyoo:GetTall()-40)
	plyrz:SetPos(10,30)
	plyrz:AddColumn("Players: # " .. #player.GetAll())
	
	local doxem = vgui.Create("DButton", Menyoo)
	doxem:SetSize(50,25)
	doxem:SetPos(Menyoo:GetWide()/2-25,Menyoo:GetTall()/2-20)
	doxem:SetText("RP Dox")
	doxem.DoClick = function() 
	
		local mark = ("|rpdox| ")
		local plyr = plyrz:GetLine(plyrz:GetSelectedLine()):GetValue(1)
		local playermoney = (v.DarkRPVars and v.DarkRPVars.money) or 0
		local playerjob = (team.GetName(v:Team())) or "nil"
	
		if plyrz:GetSelectedLine() != nil then 
		if v:IsAdmin() then
			RunConsoleCommand("say", "// " .. mark .. " NAME: " .. plyr:Nick() .. " PLAYERCASH: $" .. playermoney .. " JOB: " .. playerjob .. "(STAFF)")
		else
			RunConsoleCommand("say", "// " .. mark .. " NAME: " .. plyr:Nick() .. " PLAYERCASH: $" .. playermoney .. " JOB: " .. playerjob)
			end
		end
	end
	
	for k, v in pairs(player.GetHumans()) do
		plyrz:AddLine(v:Nick())
	end
	
end
concommand.Add("RPDoxMenu", RPDoxMenuV3)
/*
END MENU
*/


How can I get this to stop targeting the first player that player.GetHumas() finds and actually target the player on the line selected? Thanks!

Use

DListView:OnRowSelected function on the DListView.

Crap, I wrote this when I was pretty tired, and I didn’t mean DListView at all… I meant the button. When a player is selected on the specific line and I press the button how do I get it to target that player… If DListView:OnRowSelected is what I need, how exactly do I use it? I’m new to lua in general and Menus haven’t quite been the most simple thing.
Thanks!

Send me your steam id in a pm, i’ll get home and help you out

dont worry i will handle it from here

Menyoo is a gta 5 mod, case closed.