Hello guys, I trying to handle this problem for 6 hours now... But I cant find the solution. So I decided to ask the community 4 help. I would like t Code: var mainBrowser = null; API.onServerEventTrigger.connect(function (eventName) { if(eventName == "Eventlgin"){ var res = API.getScreenResolution(); //Screen res mainBrowser = API.createCefBrowser((300), (500), true); API.waitUntilCefBrowserInit(mainBrowser); API.setCefBrowserPosition(mainBrowser, 810, 290); API.loadPageCefBrowser(mainBrowser, "login.html"); API.showCursor(true); } }); function login(Username, Password) { API.showCursor(false); //stop showing the cursor API.destroyCefBrowser(myBrowser); //destroy the CEF browser API.setCanOpenChat(true); //allow the player to use the chat again. API.triggerServerEvent("LoginEvent",username, password); } Code: API.onPlayerFinishedDownload += API_onPlayerFinishedDownload; } private void API_onPlayerFinishedDownload(Client player) { API.triggerClientEvent(player, "Eventlgin"); } HTML: <!doctype html> <script> function logPlayer() { var username = document.getElementById("username").value; var password = document.getElementById("password").value; resourceCall("Login", username, password); } </script> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { min-height: 100vh; margin: 0; padding: 0; } #mainform { aligin:center; width:300px; margin:0 auto; } </style> </head> <body> <form id="mainform" action="/" method="post"> <input type="text" id="username" placeholder="username"/> <input type="password" id="password" placeholder="password"/> <button onclick="logPlayer()"class="button button-block"/>Login</button> </form> </body> </html>
I'm pretty sure he was about to say "tea" Make sure that your meta.xml is correcct and post the content of your local error logs (C:\GTANetwork\logs, error & cef)
I dont get any errors in the console. Im just wondering why I cant see the content of the html file. I have already read some articles about CEF but it didnt help me.
Like I said you should upload your error logs, those errors don't show up in the console. We need those logs otherwise it's impossible to tell whats the matter with your code
I'd say that it has trouble loading the HTML, CEF seems to start up properly just has nothing to display! Could you upload the contents of your meta.xml aswell ? that file is necessary for GTANet.Work resources to work! I assume you have a typo somewhere in the meta.xml.. And is your html file really called "login.html" and is in the same folder as the file that calls / opens the CEF browser ?
Please try to add Code: API.sleep(1000); after: Code: API.waitUntilCefBrowserInit(mainBrowser); just for a test.
Yes, he shouldnt. But there is a bug with this not functioning always. https://bt.gtanet.work/view.php?id=54
Good evening! First of all I'd like to thank u all for your help and advices. I have found the solution for my problem. PsychOrange was right the HTML file was not loading because the meta.xml file contained a wrong path. Its makes me happy to see that people help each other in this community and give them answer/solutions for their questions/problems. That's awesome!
Glad to heat that we could help you fix it, I've messed up some xmls aswell, had the exact same problem a few days ago ^^