Jump to content

rtraugutt

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by rtraugutt

  1. Hello. Today I've been trying to create HTML-based login panel for my server. Everything is set up, but it seems like the Ajax requests can't be handled. I've tested if JavaScript works and if the requests themselves are sent and it seems like both JavaScript works and requests are sent. Lua: local screenW, screenH = guiGetScreenSize() local webBrowserGUI = guiCreateBrowser(500, 500, screenW, screenH, true, false, false) local webBrowser = guiGetBrowser(webBrowserGUI) setBrowserAjaxHandler(webBrowser, "index.html", function(get, post) for k, v in pairs(get) do print(string.format("REQUEST %s = %s", k, v)) end end) addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "http://mta/local/files/index.html") guiSetInputEnabled(true) showCursor(true) toggleAllControls(false) end) HTML: <html lang="pl"> <head> <meta charset="utf-8"/> </head> <body> <section> <table> <tr> <td style="width: 10%">Nick:</td> <td><input type="text" id="nick"/></td> </tr> <tr> <td>Password:</td> <td><input type="password" id="password"/></td> </tr> </table> <button id="login">Login</button> <button id="register">Register</button> </section> </body> <script> const nick = document.getElementById("nick") const password = document.getElementById("password") const login = document.getElementById("login") const register = document.getElementById("register") login.addEventListener("click", () => { const xhr = new XMLHttpRequest() xhr.open("GET", `http://mta/local/files/index.html?nick=${nick.value}&password=${password.value}&method=login`) xhr.send() }) register.addEventListener("click", () => { const xhr = new XMLHttpRequest() xhr.open("GET", `http://mta/local/files/index.html?nick=${nick.value}&password=${password.value}&method=register`) xhr.send() }) </script> </html>
  2. First of all I am going to explain the whole situation. I was playing on a polish server when my internet connection was disturbed. I went offline for about 5 minutes. When I came back online and tried to reconnect to the server, I was immiediately disconnected and told: "Disconnected: You've been banned by MTA. Reason: MFT". Then there is my serial number: 2CA2DEBF0ADFC15DACA775002206B9A1
  3. First of all I am going to explain the whole situation. I was playing on a polish server when my internet connection was disturbed. I went offline for about 5 minutes. When I came back online and tried to reconnect to the server, I was immiediately disconnected and told: "Disconnected: You've been banned by MTA. Reason: MFT". Then there is my serial number: 2CA2DEBF0ADFC15DACA775002206B9A1
×
×
  • Create New...