rouzbeh_TopGTA Posted October 10, 2016 Share Posted October 10, 2016 Whats the :O Going ON? why you disabled CEF in mta 1.5.3? im sure me and a lot of other server owners Never Update to 1.5.3 if it Still Disabled... Link to comment
Jusonex Posted October 10, 2016 Share Posted October 10, 2016 CEF isn't disabled. Why do you think that? Link to comment
Gravestone Posted October 10, 2016 Share Posted October 10, 2016 Quote Disabled CEF plugins (e.g. Flash Player) CEF Plugins were disabled, not CEF itself. Link to comment
rouzbeh_TopGTA Posted October 10, 2016 Author Share Posted October 10, 2016 10 hours ago, Gravestone said: CEF Plugins were disabled, not CEF itself. My Login Panel working with HTML and JS , i tried mta 1.5.3 and then login panel (java script) not work! Link to comment
Jusonex Posted October 10, 2016 Share Posted October 10, 2016 Does the webbrowser resource work for you? (start webbrowser, press Alt and click on the Chromium icon in the left bottom corner). If not, please run MTADiag (Download) Link to comment
rouzbeh_TopGTA Posted October 10, 2016 Author Share Posted October 10, 2016 (edited) 10 hours ago, Jusonex said: Does the webbrowser resource work for you? (start webbrowser, press Alt and click on the Chromium icon in the left bottom corner). If not, please run MTADiag (Download) webbrowser resource Work in my login panel, when u click on login or register button its trigger a event from js to lua with mta 1.5.3 login/register buttons didnt work! ( html and all files are local ) Edited October 10, 2016 by rouzbeh_TopGTA Link to comment
Bonsai Posted October 10, 2016 Share Posted October 10, 2016 (edited) I'm having the same problem. Neither the lua nor the js part have been changed. The events are just not triggered by mta.triggerEvent function anymore. Another thing I noticed, the event "onClientBrowserCreated" now seems to need the actual browser element as its source. Before it was working using the gui browser element too. Thats rather a fix than a bug, but at first it didn't load anything at all, until I changed this. (In case someone has the same mistake in their scripts) Edited October 10, 2016 by Bonsai Link to comment
Jusonex Posted October 10, 2016 Share Posted October 10, 2016 Could you show me the Lua code where you register the event that is triggered from Javascript and the guiCreateBrowser/createBrowser call? E.g.: local browser = createBrowser(...) addEventHandler("eventCalledFromJS", browser, function() -- ... end ) Link to comment
Bonsai Posted October 10, 2016 Share Posted October 10, 2016 Login.url = "http://mta/local/lobby/html/index.html" Login.browser = guiCreateBrowser(0, 0, Login.x, Login.y, true, true, false) guiSetVisible(Login.browser, false) function Login.create() addEventHandler("onPlayerGuestButton", root, Login.guestButtonHandler) end addEvent("onShowLogin") addEventHandler("onShowLogin", root, Login.create) function Login.browserCreated() loadBrowserURL(source, Login.url) end addEventHandler("onClientBrowserCreated", guiGetBrowser(Login.browser), Login.browserCreated) function Login.guestButtonHandler() triggerServerEvent("onGuest", localPlayer) end addEvent("onPlayerGuestButton") The handler is later removed again in another function. Link to comment
rouzbeh_TopGTA Posted October 10, 2016 Author Share Posted October 10, 2016 (edited) 10 hours ago, Jusonex said: Could you show me the Lua code where you register the event that is triggered from Javascript and the guiCreateBrowser/createBrowser call? E.g.: local browser = createBrowser(...)addEventHandler("eventCalledFromJS", browser, function() -- ... end) local page = "http://mta/local/index.html" local screenWidth, screenHeight = guiGetScreenSize() initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, true, false) theBrowser = guiGetBrowser(initBrowser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, page) guiSetInputEnabled(true) sound = playSound("files/login.mp3", true) setSoundVolume(sound, 0.8) addNotification("Please login or create a new account!", "info") end ) client - be triggered from js: function clientClickLogin (user, pass, rem) playSound( "files/click.mp3" ) if user and pass then if ( string.gsub ( user, ' ', '' ) ~= '' and string.gsub ( pass, ' ', '' ) ~= '' ) then if ( string.find ( user, '%s' ) ) then return addNotification ( "Spaces (' ') are not allowed in the username.", "error" ) elseif ( string.find ( pass, '%s' ) ) then return addNotification ( "Spaces (' ') are not allowed in the password.", "error" ) end rem = tonumber(rem) if rem == 1 then data.remember.clicked = true elseif rem == 2 then data.remember.clicked = false end triggerServerEvent ( "Login:onClientAttemptLogin", localPlayer, user, pass ) clicked = true else addNotification("A Username And Password Are Required To Access The Server.", "warning") end else addNotification("A Username And Password Are Required To Access The Server.", "warning") end end addEvent("clientClickLoginEvent", true) addEventHandler("clientClickLoginEvent", root, clientClickLogin) js: function loginTrigger() { var UsernameValue = $( "#UserLogin" ).val(); var PasswordValue = $( "#PasswordLogin" ).val(); if(document.getElementById("rememberme").checked) { mta.triggerEvent("clientClickLoginEvent", UsernameValue, PasswordValue, 1) }else { mta.triggerEvent("clientClickLoginEvent", UsernameValue, PasswordValue, 2) } } html: <form action="javascript:loginTrigger()" method="post"> <input id="UserLogin" type="text" name="u" placeholder="Username" required="required" /> <input id="PasswordLogin" type="password" name="p" placeholder="Password" required="required" /> <input id="rememberme" type="checkbox" /><img class="remember" src="files/remember.png" /> <button type="submit" class="btn btn-primary btn-block btn-large">Login</button> </form> Edited October 10, 2016 by rouzbeh_TopGTA Link to comment
Jusonex Posted October 10, 2016 Share Posted October 10, 2016 Alright, it's a bug in MTA. It is fixed in the upcoming nightly though. 3 Link to comment
Recommended Posts