Dimos7 Posted December 22, 2016 Share Posted December 22, 2016 Hello there i have make a browser i want to take sound and delete the browser when play then sound but i can make it write on browser any help local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255, 255, 255, 255), true) showCursor(true) end addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(source, "http://www.youtube.com") addEventHandler("onClientRender", root, webBrowserRender) sound = playSound(getBrowserURL(webBrowser)) setBrowserVolume(webBrowser, 0.5) if sound then removeEventHandler("onClientRender", root, webBrowserRender) showCursor(false) end end ) Link to comment
Arran Posted December 22, 2016 Share Posted December 22, 2016 Please elaborate on what you mean by " take sound and delete the browser when play then sound " because it doesn't make sense. Link to comment
Dimos7 Posted December 22, 2016 Author Share Posted December 22, 2016 i mean when a player write a song and click on video i want removeEvent fro image but the sound keep play Link to comment
koragg Posted December 22, 2016 Share Posted December 22, 2016 He wants to keep everything active even if user closes the browser window. Link to comment
Dimos7 Posted December 22, 2016 Author Share Posted December 22, 2016 and be able to write in webbrowser Link to comment
Arran Posted December 22, 2016 Share Posted December 22, 2016 58 minutes ago, Dimos7 said: sound = playSound(getBrowserURL(webBrowser)) This will execute as: playSound("http://www.youtube.com") which isn't useful. Don't you want them to pick a video to play first? Why not just add a GUI button so that they can close the browser once they've picked something to play? The music of the video would then play in the background which is what you want? Link to comment
Dimos7 Posted December 22, 2016 Author Share Posted December 22, 2016 fristly i want make it be able write and then when click on video play the song Link to comment
Arran Posted December 23, 2016 Share Posted December 23, 2016 There is a web browser resource that comes with MTA called 'webbrowser' so you can either let players use that or you can copy some of the code that's in it as it allows players to enter a URL to play a video and there's a button to close it. Link to comment
ViRuZGamiing Posted December 23, 2016 Share Posted December 23, 2016 For interactive browser look at guiCreateBrowser instead of createBrowser Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now