benwilkins Posted November 25, 2017 Share Posted November 25, 2017 function toggle () local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 0, 0, screenWidth/1.2, screenHeight/1.2, "Mobile Data Computer", false ) exports.global:centerWindow(window) guiSetInputEnabled(not guiGetInputEnabled()) guiWindowSetSizable ( window, false ) guiSetAlpha( window, 255) local browser = guiCreateBrowser( 0, 28, screenWidth/1.2, screenHeight/1.35, false, false, false, window ) local theBrowser = guiGetBrowser( browser ) local closeButton = guiCreateButton( 0, (screenHeight/1.35)+40, screenWidth/1.2, 50, "Close Mobile Data Computer", false, window ) addEventHandler("onClientGUIClick", closeButton, function () destroyElement(window) destroyElement(browser) destroyElement(theBrowser) destroyElement(closeButton) window = nil browser = nil theBrowser = nil guiSetInputEnabled(not guiGetInputEnabled()) end) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://facebook.com" ) end ) end addCommandHandler("callmdc", toggle ) addEventHandler("onClientResourceStart", getResourceRootElement(), function() requestBrowserDomains({"http://facebook.com"}) end ) This code works fine sometimes, when I do it, its fine, but for everyone else, it just shows the GUI window, with no browser inside. No errors in debug. Link to comment
Moderators IIYAMA Posted November 25, 2017 Moderators Share Posted November 25, 2017 Try the load the url after the browser white-list has been updated: https://wiki.multitheftauto.com/wiki/RequestBrowserDomains https://wiki.multitheftauto.com/wiki/OnClientBrowserWhitelistChange 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