Wumbaloo Posted April 13, 2017 Share Posted April 13, 2017 (edited) Hey, Today I would like to upgrade my code, for this, I need to use CEF. But this not work, I downloaded exemples from internet and realized my own resource, my screen ingame is empty, no browser, anything. Here's my index.html: <!DOCTYPE html> <html> <head> <title>Hello</title> </head> <body> Hey this is a little page just for testing CEF in MTA! </body> </html> Here's my meta.xml: <meta> <info author="Wumbaloo" version="1.0" name="CEF" description="Test"/> <script src="cef.lua" type="client" /> <file src="index.html"/> </meta> And this is my cef.lua: local browser = guiCreateBrowser( 1920/2-1600/2, 1080/2-900/2, 1600, 900, false, false, false, window ) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "index.html" ) end ) Also tried with "loadBrowserURL(source, "http://mta/local/index.html") and rendered the browser in a "onClientRender" event Edited April 13, 2017 by Wumbaloo Link to comment
NanoBob Posted April 13, 2017 Share Posted April 13, 2017 The documentation for guiCreateBrowser specifies the 5th argument "isLocal" is required to be set to true if the page you are loading is from a local file. You set this to false meaning you can only load public websites, not local files. Change this to true and it should work just fine. Link to comment
Wumbaloo Posted April 14, 2017 Author Share Posted April 14, 2017 (edited) It worked, change the 5th argument and set the URL to "http://mta/local/myFile.html" Sorry for this little problem, it was late so my brain was turned off haha Edited April 14, 2017 by Wumbaloo 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