Clientwebradio VGUI error, but it worked before !

Hi, I want use clientwebradion but there is a error :
[addons\clientwebradio\lua\autorun\webradio.lua:44] attempt to index global ‘vgui’ (a nil value)
I don’t how it happened, it worked and the next hour there was this error.
There’s the script : (clientwebradio.lua)

[lua]
AddCSLuaFile(“autorun/webradio.lua”)

– Comment is placed here!
– You should edit file to your own settings
– If you edit this file remove the prefix http:// else it won’t work!
– Link1 Example to setup your Internet radio links
– link1name = “Radio your url!”
– link1url = “www.yoururl.com/something.***
– The *** is for the extension of the file.
– It should support .asx .asp .mp3 .m3u .wma .wav
– And maybe some other extensions.
– Link 1
local link1name = “TechnoBase.FM”
local link1url = “listen.technobase.fm/dsl.asx”
– Link 2
local link2name = “Techno4Ever.net
local link2url = “www.techno4ever.net/t4e/stream/dsl_listen.asx
–Link 3
local link3name = “EinsLive”
local link3url = “www.wdr.de/wdrlive/media/einslive-wm32.asx
–Link 4
local link4name = “HardBase.FM”
local link4url = “listen.hardbase.fm/dsl.asx”
–Link 5
local link5name = “RTL Radio”
local link5url = “lsd.newmedia.nacamar.net/bb/redirect.lsc?adid=0&stream=rtlradio/livestream.wma&content=live&media=ms&token=8216056d6f94d4b6833b99c1bdec8607

– You don’t have to change anything beneeth this line!
local check = 0
local url = [[
</head>
<body>
Just some Player that plays web radios! Settings for admin at the webclient.lua… read the with the --parts
</body>
</html>
]]

concommand.Add("+wmp", function( ply, com, args )

if check == 0 then
    Winmain = vgui.Create("DFrame") -- Line 44
    Winmain:SetPos(10,10);
    Winmain:SetSize(420,200);
    Winmain:SetVisible(true);
    Winmain:SetTitle( "Garry's Mod Streaming Player" );
    Winmain:MakePopup();
    Winmain:ShowCloseButton( false );
    Winmp = vgui.Create( "HTML" , Winmain);
    Winmp:SetPos(0,130);
    Winmp:SetSize(420,85);
    Winmp:SetVisible(true);
    Winmp:SetHTML( url );
    Winmp:Refresh(true);
    check = 1
    local Button1 = vgui.Create( "DButton" );
    Button1:SetParent    (Winmain);
    Button1:SetText        (link1name);
    Button1:SetSize     (75,25);
    Button1:SetPos         (25,50);
    Button1.DoClick = function () 
    url = [[ &lt;EMBED TYPE="application/x-mplayer2" 
    SRC = "http://]]..link1url..[[" NAME = "MediaPlayer" WIDTH = "400" HEIGHT = "30"
    ShowControls = "1" ShowStatusBar = "0" ShowDisplay = "0"
    autostart = "1"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt; 
    ]] 
    Winmp:SetHTML( url );
    end
    local Button2 = vgui.Create( "DButton" );
    Button2:SetParent    (Winmain);
    Button2:SetText        (link2name);
    Button2:SetSize     (75,25);
    Button2:SetPos         (100,50);
    Button2.DoClick = function() 
    url = [[ &lt;EMBED TYPE="application/x-mplayer2" 
    SRC = "http://]]..link2url..[[" NAME = "MediaPlayer" WIDTH = "400" HEIGHT = "30"
    ShowControls = "1" ShowStatusBar = "0" ShowDisplay = "0"
    autostart = "1"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt; 
    ]] 
    Winmp:SetHTML( url );
    end
    local Button3 = vgui.Create( "DButton" );
    Button3:SetParent    (Winmain);
    Button3:SetText        (link3name);
    Button3:SetSize     (75,25);
    Button3:SetPos         (175,50);
    Button3.DoClick = function()
    url = [[ &lt;EMBED TYPE="application/x-mplayer2" 
    SRC = "http://]]..link3url..[[" NAME = "MediaPlayer" WIDTH = "400" HEIGHT = "30"
    ShowControls = "1" ShowStatusBar = "0" ShowDisplay = "0"
    autostart = "1"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt; 
    ]] 
    Winmp:SetHTML( url );
    end
    local Button4 = vgui.Create( "DButton" )
    Button4:SetParent     (Winmain);
    Button4:SetText     ("Minimalize");
    Button4:SetSize     (75,25);
    Button4:SetPos         (250,50);
    Button4.DoClick = function()
    Winmain:SetVisible    (false)
    end
    local Button5 = vgui.Create( "DButton" )
    Button5:SetParent     (Winmain);
    Button5:SetText     (link4name);
    Button5:SetSize        (75,25);
    Button5:SetPos        (25,80);
        Button5.DoClick = function()
    url = [[ &lt;EMBED TYPE="application/x-mplayer2" 
    SRC = "http://]]..link4url..[[" NAME = "MediaPlayer" WIDTH = "400" HEIGHT = "30"
    ShowControls = "1" ShowStatusBar = "0" ShowDisplay = "0"
    autostart = "1"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt; ]]
    Winmp:SetHTML( url );
    end
    local Button6 = vgui.Create ( "DButton")
    Button6:SetParent     (Winmain);
    Button6:SetText     (link5name);
    Button6:SetSize        (75,25);
    Button6:SetPos        (100,80);
        Button6.DoClick = function()
        url = [[ &lt;EMBED TYPE="application/x-mplayer2" 
    SRC = "http://]]..link5url..[[" NAME = "MediaPlayer" WIDTH = "400" HEIGHT = "30"
    ShowControls = "1" ShowStatusBar = "0" ShowDisplay = "0"
    autostart = "1"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt; ]]
    Winmp:SetHTML( url );
    end
else
    Winmain:SetVisible(true)
    
end

end )

concommand.Add("-wmp", function( ply, com, args )
Winmain:SetVisible(false)
end )

concommand.Add(“wmplink”,function(ply,com,args)
linkh = args[1]
local url = [[
<EMBED TYPE=“application/x-mplayer2” SRC = “http://]]…linkh…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30” ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0” autostart = “1”></EMBED></OBJECT>
]]
Winmp:SetHTML( url );
Winmp:Refresh(true)
end)
print("[WindowsGmodplayer] WGP has loaded =D
WGP is made by Turion with help of {iG} I_am_McLovin and AwatemonoSan")
[/lua]
[editline]19th June 2011[/editline]

Oops I have forgotten to say, Thanks for help !
Bye
-max360

FOR EVERY ONE : THE PROBLEM IS RESOLVED, THANK YOU RetTurtl3

Goes in
[release]garrysmod/lua/autorun/webradio.lua[/release]

[lua]if SERVER then
AddCSLuaFile(“autorun/webradio.lua”)
else
– Comment is placed here!
– You should edit file to your own settings
– If you edit this file remove the prefix http:// else it won’t work!
– Link1 Example to setup your Internet radio links
– link1name = “Radio your url!”
– link1url = “www.yoururl.com/something.***
– The *** is for the extension of the file.
– It should support .asx .asp .mp3 .m3u .wma .wav
– And maybe some other extensions.
– Link 1
local link1name = “TechnoBase.FM”
local link1url = “listen.technobase.fm/dsl.asx”
– Link 2
local link2name = “Techno4Ever.net
local link2url = “www.techno4ever.net/t4e/stream/dsl_listen.asx
–Link 3
local link3name = “EinsLive”
local link3url = “www.wdr.de/wdrlive/media/einslive-wm32.asx
–Link 4
local link4name = “HardBase.FM”
local link4url = “listen.hardbase.fm/dsl.asx”
–Link 5
local link5name = “RTL Radio”
local link5url = “lsd.newmedia.nacamar.net/bb/redirect.lsc?adid=0&stream=rtlradio/livestream.wma&content=live&media=ms&token=8216056 d6f94d4b6833b99c1bdec8607”

– You don’t have to change anything beneeth this line!
local check = 0
local url = [[
</head>
<body>
Just some Player that plays web radios! Settings for admin at the webclient.lua… read the with the --parts
</body>
</html>
]]

concommand.Add("+wmp", function( ply, com, args )

if check == 0 then
Winmain = vgui.Create(“DFrame”) – Line 44
Winmain:SetPos(10,10);
Winmain:SetSize(420,200);
Winmain:SetVisible(true);
Winmain:SetTitle( “Garry’s Mod Streaming Player” );
Winmain:MakePopup();
Winmain:ShowCloseButton( false );
Winmp = vgui.Create( “HTML” , Winmain);
Winmp:SetPos(0,130);
Winmp:SetSize(420,85);
Winmp:SetVisible(true);
Winmp:SetHTML( url );
Winmp:Refresh(true);
check = 1
local Button1 = vgui.Create( “DButton” );
Button1:SetParent (Winmain);
Button1:SetText (link1name);
Button1:SetSize (75,25);
Button1:SetPos (25,50);
Button1.DoClick = function ()
url = [[ <EMBED TYPE=“application/x-mplayer2”
SRC = “http://]]…link1url…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30”
ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0”
autostart = “1”></EMBED></OBJECT>
]]
Winmp:SetHTML( url );
end
local Button2 = vgui.Create( “DButton” );
Button2:SetParent (Winmain);
Button2:SetText (link2name);
Button2:SetSize (75,25);
Button2:SetPos (100,50);
Button2.DoClick = function()
url = [[ <EMBED TYPE=“application/x-mplayer2”
SRC = “http://]]…link2url…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30”
ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0”
autostart = “1”></EMBED></OBJECT>
]]
Winmp:SetHTML( url );
end
local Button3 = vgui.Create( “DButton” );
Button3:SetParent (Winmain);
Button3:SetText (link3name);
Button3:SetSize (75,25);
Button3:SetPos (175,50);
Button3.DoClick = function()
url = [[ <EMBED TYPE=“application/x-mplayer2”
SRC = “http://]]…link3url…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30”
ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0”
autostart = “1”></EMBED></OBJECT>
]]
Winmp:SetHTML( url );
end
local Button4 = vgui.Create( “DButton” )
Button4:SetParent (Winmain);
Button4:SetText (“Minimalize”);
Button4:SetSize (75,25);
Button4:SetPos (250,50);
Button4.DoClick = function()
Winmain:SetVisible (false)
end
local Button5 = vgui.Create( “DButton” )
Button5:SetParent (Winmain);
Button5:SetText (link4name);
Button5:SetSize (75,25);
Button5:SetPos (25,80);
Button5.DoClick = function()
url = [[ <EMBED TYPE=“application/x-mplayer2”
SRC = “http://]]…link4url…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30”
ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0”
autostart = “1”></EMBED></OBJECT> ]]
Winmp:SetHTML( url );
end
local Button6 = vgui.Create ( “DButton”)
Button6:SetParent (Winmain);
Button6:SetText (link5name);
Button6:SetSize (75,25);
Button6:SetPos (100,80);
Button6.DoClick = function()
url = [[ <EMBED TYPE=“application/x-mplayer2”
SRC = “http://]]…link5url…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30”
ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0”
autostart = “1”></EMBED></OBJECT> ]]
Winmp:SetHTML( url );
end
else
Winmain:SetVisible(true)

end

end )

concommand.Add("-wmp", function( ply, com, args )
Winmain:SetVisible(false)
end )

concommand.Add(“wmplink”,function(ply,com,args)
linkh = args[1]
local url = [[
<EMBED TYPE=“application/x-mplayer2” SRC = “http://]]…linkh…[[” NAME = “MediaPlayer” WIDTH = “400” HEIGHT = “30” ShowControls = “1” ShowStatusBar = “0” ShowDisplay = “0” autostart = “1”></EMBED></OBJECT>
]]
Winmp:SetHTML( url );
Winmp:Refresh(true)
end)
print("[WindowsGmodplayer] WGP has loaded =D
WGP is made by Turion with help of {iG} I_am_McLovin and AwatemonoSan")
end
[/lua]

THANK YOU VERY MUCH ! it works !

You’re welcome :slight_smile: