ysj4 Posted August 27, 2021 Posted August 27, 2021 (edited) hello so i created a website based on javascript UI, when i load CEF in MTA, UI doesn't show up, don't know why, all files in meta.xml are typed my code; local screenWidth, screenHeight = guiGetScreenSize() local page = "http://mta/mywebsite/index.html" local initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, false, false) local theBrowser = guiGetBrowser(initBrowser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, page) showCursor(true) end ) my code in HTML head <script type="text/javascript" src="js/myUI.js"></script> Edited August 27, 2021 by ysj4
vicisdev Posted August 27, 2021 Posted August 27, 2021 (edited) If you've written your meta.xml properly the URL should be http://mta/local/<path_to_.html>. You've missed the /local/. Edited August 27, 2021 by vicisdev
vicisdev Posted August 27, 2021 Posted August 27, 2021 38 minutes ago, vicisdev said: If you've written your meta.xml properly the URL should be http://mta/local/<path_to_.html>. You've missed the /local/. Excuse me. In fact, /local/ is supposed to be the resource name. So you would do http://mta/<resource_name>/<path_to_html> if your .html is located in another resource otherwise you can still use /local/ for files located in the same resource. You should add your index.html file using the <file /> tag in your meta.xml. https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler
ysj4 Posted August 28, 2021 Author Posted August 28, 2021 (edited) 23 hours ago, vicisdev said: Excuse me. In fact, /local/ is supposed to be the resource name. So you would do http://mta/<resource_name>/<path_to_html> if your .html is located in another resource otherwise you can still use /local/ for files located in the same resource. You should add your index.html file using the <file /> tag in your meta.xml. https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler I think my files its ok, but UI still not load. https://imgur.com/a/rhj4n5c (dont look at auth_server type, its my fault) Edited August 28, 2021 by ysj4
vicisdev Posted August 29, 2021 Posted August 29, 2021 21 hours ago, ysj4 said: I think my files its ok, but UI still not load. https://imgur.com/a/rhj4n5c (dont look at auth_server type, its my fault) You should always check logs to see what is happening. Run your script in debug mode 3 and check the console output. You can: 1. OutputDebugString(inspect(theBrowser)) to see if it's being created properly 2. Try to load an external source (https://mtasa.com)
ysj4 Posted August 29, 2021 Author Posted August 29, 2021 28 minutes ago, vicisdev said: You should always check logs to see what is happening. Run your script in debug mode 3 and check the console output. You can: 1. OutputDebugString(inspect(theBrowser)) to see if it's being created properly 2. Try to load an external source (https://mtasa.com) 1. when i start my resource with my website only black background shows, its ok because i set dark background in CSS. But JS UI doesnt show's up (debug nothing shows) 2. starting with inspect output 3. page of mta doesnt shows up https://imgur.com/a/dlfGLNE
vicisdev Posted August 29, 2021 Posted August 29, 2021 5 minutes ago, ysj4 said: 1. when i start my resource with my website only black background shows, its ok because i set dark background in CSS. But JS UI doesnt show's up (debug nothing shows) 2. starting with inspect output 3. page of mta doesnt shows up https://imgur.com/a/dlfGLNE Could you send me your files so I can inspect it better? 1
ysj4 Posted August 29, 2021 Author Posted August 29, 2021 3 minutes ago, vicisdev said: Could you send me your files so I can inspect it better? check private message 1
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