Having a little trouble with my Derma Menu

Hello, I have PlayX installed on my server and I want to make a derma menu to manage it.

I have this so far:


function cinemamenu( ply )
if ply:Team() == TEAM_MOVIE then

DFrame1 = vgui.Create('DFrame')
DFrame1:SetSize(372, 123)
DFrame1:Center()
DFrame1:SetTitle('Clip Selector')
DFrame1:SetDeleteOnClose(false)
DFrame1:MakePopup()

DTextEntry1 = vgui.Create('DTextEntry')
DTextEntry1:SetParent(DFrame1)
DTextEntry1:SetSize(242, 21)
DTextEntry1:SetPos(6, 91)
DTextEntry1:SetText('')
DTextEntry1.OnEnter = function()
	RunConsoleCommand( url )
end

DLabel1 = vgui.Create('DLabel')
DLabel1:SetParent(DFrame1)
DLabel1:SetPos(16, 61)
DLabel1:SetText('To use, paste YouTube URL and press enter!')
DLabel1:SizeToContents()
DLabel1:SetTextColor(Color(50, 205, 50, 255))

else
ply:PrintMessage( HUD_PRINTTALK, " This action requires you to be Movie Manager. " )
end
end
concommand.Add( "cinema_menu", cinemamenu )

So, I need the YouTube URL that is entered in the derma text box to play VIA PlayX.

EG. You paste

and press enter and it will open the video.

[editline]24th May 2013[/editline]

The console command is

Change


RunConsoleCommand( url )

to


RunConsoleCommand( "playx_open", DTextEntry1:GetValue() )

TIP: You should find a way to make it know if the text that is in the DTextEntry1 is an URL or not.

You sir, are a legend, and a life saver. <3

  • snip -