1. Post #1
    Glod Menber
    Amez's Avatar
    June 2008
    6,690 Posts
    Can someone make a simple mp3 player for SP? The one I used to to use is broken and I find the current mp3 players to be way too bulky for my liking.

    Someone made this in another thread but didn't release it, he only used it to prove a point to someone.



    And to add music all I had to do before was put it all in a folder and that's it.

    Thanks in advance!

    I didn't want to bump the thread up but thanks a lot for the mp3 player below! I appreciate it :).

  2. Post #2
    Gold Member
    thegrb93's Avatar
    June 2006
    1,369 Posts
    This is a simple one i made a while back.
    concommand.Add("List_Sounds",function()
    	gui.EnableScreenClicker(true)
    	local tbl={}
    	table.Add(tbl,file.Find("sound/mymusic/*.mp3", true))
    	table.Add(tbl,file.Find("sound/mymusic/*.wav", true))
    	local frame=vgui.Create("DFrame")
    	frame:SetPos(70,200)
    	frame:SetSize(170,500)
    	frame:SetName("Songs")
    	frame:SetTitle("Songs")
    	frame.Close=function(self)
    		self:Remove()
    		gui.EnableScreenClicker(false)
    	end 
    	
    	local panel=vgui.Create("DPanel", frame)
    	panel:SetPos(0,40)
    	panel:SetSize(170,440)
    	panel.Paint=function() return end
    	
    	local List = vgui.Create( "DPanelList", panel)
    	List:SetPos( 20, 0 )
    	List:SetSize( 130, #tbl*30 )
    	List:SetSpacing( 10 )
    	
    	panel.OnMouseWheeled=function(p, u) 
    		local temp=List.Y+tonumber(u*20)
    		if temp>0 then temp=0 end
    		if temp<List:GetTall()*-1+panel:GetTall() then temp=List:GetTall()*-1+panel:GetTall() end
    		List.Y=temp
    	end
    	
    	for k, v in pairs(tbl) do
    		local btn=vgui.Create("DButton", List)
    		btn:SetSize(130,20)
    		btn:SetText(v)
    		btn.OnMousePressed=function() RunConsoleCommand("play","mymusic/"..v) gui.EnableScreenClicker(false) frame:Remove() end
    		
    		List:AddItem(btn)
    	end
    	
    end)
    

    list_sounds in console to open it and put music in sound/mymusic.
    save in lua/autorun/client as something.lua
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 2 (list)