xXGhostXx Posted November 14, 2019 Share Posted November 14, 2019 Hi guys. How can i make loading screen on player loading server data like FiveM ? Link to comment
edge Posted November 14, 2019 Share Posted November 14, 2019 That's quite simple. local screen = {guiGetScreenSize()} local page = "http://mta/local/yourfile.html" function downloadGUI() browser = guiCreateBrowser(0,0,screen[1],screen[2],true,true,false) --display the Browser bg = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", bg, function() loadBrowserURL(source, page) end) end addEventHandler("onClientRender", root, downloadGUI) function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) -- Check again after 2 seconds else removeEventHandler("onClientRender", root, downloadGUI) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer) Also you need to update your download_priority_group field in meta.xml. Link to comment
xXGhostXx Posted November 14, 2019 Author Share Posted November 14, 2019 1 hour ago, edge said: That's quite simple. local screen = {guiGetScreenSize()} local page = "http://mta/local/yourfile.html" function downloadGUI() browser = guiCreateBrowser(0,0,screen[1],screen[2],true,true,false) --display the Browser bg = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", bg, function() loadBrowserURL(source, page) end) end addEventHandler("onClientRender", root, downloadGUI) function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) -- Check again after 2 seconds else removeEventHandler("onClientRender", root, downloadGUI) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer) Also you need to update your download_priority_group field in meta.xml. Don't work. Meta: <meta> <script src="Loading.Lua" type="client" /> <file src="index.html" /> <download_priority_group>1</download_priority_group> </meta> Client: local screen = {guiGetScreenSize()} local page = "http://mta/local/index.html" function downloadGUI() browser = guiCreateBrowser(0,0,screen[1],screen[2],true,true,false) --display the Browser bg = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", bg, function() loadBrowserURL(source, page) end) end addEventHandler("onClientRender", root, downloadGUI) function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) -- Check again after 2 seconds else removeEventHandler("onClientRender", root, downloadGUI) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer) Link to comment
iiv03 Posted November 14, 2019 Share Posted November 14, 2019 in meta you can't use file with html <html src="filename.html" /> 7 minutes ago, xXGhostXx said: Don't work. Meta: <meta> <script src="Loading.Lua" type="client" /> <file src="index.html" /> <download_priority_group>1</download_priority_group> </meta> Client: local screen = {guiGetScreenSize()} local page = "http://mta/local/index.html" function downloadGUI() browser = guiCreateBrowser(0,0,screen[1],screen[2],true,true,false) --display the Browser bg = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", bg, function() loadBrowserURL(source, page) end) end addEventHandler("onClientRender", root, downloadGUI) function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) -- Check again after 2 seconds else removeEventHandler("onClientRender", root, downloadGUI) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer) https://wiki.multitheftauto.com/wiki/Resource_Web_Access Link to comment
xXGhostXx Posted November 14, 2019 Author Share Posted November 14, 2019 4 minutes ago, xFabel said: in meta you can't use file with html <html src="filename.html" /> Don't work please test script Link to comment
edge Posted November 14, 2019 Share Posted November 14, 2019 This works just when the files are being downloaded. Try to remove all your cached-files and enter your server. If that doesn't works, we'll check that. I don't think it didn't works, but I'll test it soon. Link to comment
xXGhostXx Posted November 15, 2019 Author Share Posted November 15, 2019 10 hours ago, edge said: This works just when the files are being downloaded. Try to remove all your cached-files and enter your server. If that doesn't works, we'll check that. I don't think it didn't works, but I'll test it soon. I want on player join in my server when data loading play this html page 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