Jump to content

Gyrosos

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Gyrosos's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. English: I have 2 seperate html files, one for the login part and one for the registration part. And if i just press onto the link to open the registration HTML it gives me a blank white screen. My codes are below. Thanks for anyone who tries to help. Magyar: Szeretnék 2 külön HTML fájlból készíteni login panelt, ez addig szép és jó volt, míg nem próbáltam ki. Rámentem a regisztrációra, és egy full fehér képet adott be. Ez az egyetlen problémám egyenlőre. Előre köszönöm annak a segítségét aki segít! HTML (Login part / Bejelentkezés része) <!DOCTYPE html> <html lang="hu"> <head> <link rel="stylesheet" href="style.css"> <meta charset="utf-8"> <title>HTML Login panel by: Gyrosos</title> <style> body{ background-color: #1a1a1a; font-family: 'Arial'; } img{ display: block; margin-top: 50px; margin-left: auto; margin-right: auto; width: 20%; } #panel{ margin: auto; width: 25%; height: 50%; color: white; } #panel p{ color: white; font-size: 18px; display: block; margin-top: 15px; text-align: center; } #panel p a{ text-decoration: none; color: #ff9900; transition: .5s; border-bottom: 0px solid #ff9900; } #panel p a:hover{ border-bottom: 3px solid #ff9900; transition: .5s; } #username{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #username:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #username:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #password{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #password:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #password:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #passwordAgain{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #passwordAgain:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #passwordAgain:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #email{ width: 100%; height: 25px; margin-bottom: 50px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #email:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #email:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #loginButton{ font-size: large; display: block; width: 50%; height: 40px; margin: auto; background-color: #ff9900; color: white; border: 0px solid #804d00; transition: .5s; } #loginButton:hover{ border: 3px solid #804d00; transition: .5s; } </style> <script> function attemptLogin(){ var username = document.getElementByID('username').value var password = document.getElementByID('password').value mta.triggerEvent('attemptLogin', username, password) } </script> </head> <body> <img align="middle" src="logo.png"> <div id="panel"> <input type="text" placeholder="Felhasználónév" name="user" id="username"><br> <input type="password" placeholder="Jelszó" name="password" id="password"><br> <input type="button" value="Bejelentkezés" onclick="attemptLogin()" id="loginButton"> <p>Elfelejtetted a jelszavad, vagy még nem regisztráltál?</p> <p><a href="#">Elfelejtett adatok</a> | <a href="register.html">Regisztráció</a></p> </div> </body> </html> HTML (Registration part / Regisztráció rész) <!DOCTYPE html> <html lang="hu"> <head> <link rel="stylesheet" href="style.css"> <title>HTML Login panel by: Gyrosos</title> <meta charset="utf-8"> <style> body{ background-color: #1a1a1a; font-family: 'Arial'; } img{ display: block; margin-top: 50px; margin-left: auto; margin-right: auto; width: 20%; } #panel{ margin: auto; width: 25%; height: 50%; color: white; } #panel p{ color: white; font-size: 18px; display: block; margin-top: 15px; text-align: center; } #panel p a{ text-decoration: none; color: #ff9900; transition: .5s; border-bottom: 0px solid #ff9900; } #panel p a:hover{ border-bottom: 3px solid #ff9900; transition: .5s; } #username{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #username:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #username:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #password{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #password:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #password:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #passwordAgain{ width: 100%; height: 25px; margin-bottom: 25px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #passwordAgain:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #passwordAgain:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #email{ width: 100%; height: 25px; margin-bottom: 50px; font-size: large; background-color: #3a3a3a; border-width: 0; border-bottom: 3px solid #3a3a3a; transition: .3s; color: white; } #email:focus{ outline: none; border-bottom: 3px solid #ff9900; transition: .3s; } #email:hover{ border-bottom: 3px solid #ff9900; transition: .3s; } #loginButton{ font-size: large; display: block; width: 50%; height: 40px; margin: auto; background-color: #ff9900; color: white; border: 0px solid #804d00; transition: .5s; } #loginButton:hover{ border: 3px solid #804d00; transition: .5s; } </style> <script> function attemptRegister(){ var username = document.getElementByID("username").value var password = document.getElementByID("password").value var passwordAgain = document.getElementByID("passwordAgain").value var email = document.getElementByID("email").value mta.triggerEvent("attemptRegister", username, password, passwordAgain, email) } </script> </head> <body> <img align="middle" src="logo.png"> <div id="panel"> <input type="text" placeholder="Felhasználónév" name="user" id="username"><br> <input type="password" placeholder="Jelszó" name="password" id="password"><br> <input type="password" placeholder="Jelszó újra" name="passwordAgain" id="passwordAgain"><br> <input type="email" placeholder="Email cím" name="email" id="email"><br> <input type="button" value="Regisztráció" onclick="attemptRegister()" id="loginButton"> <p><a href="index.html">Visszalépés</a></p> </div> </body> </html> Server Lua local con = exports.cs_mysql:getConnection() addEvent('checkBannedStatus', true) addEventHandler('checkBannedStatus', getRootElement(), function(serial) local qh = dbQuery(con, "SELECT * FROM bans WHERE serial=? AND banned_until > banned_date", serial) local bans = dbPoll(qh, 500) if bans then if #bans > 0 then return true else return false end else return false end end) function attemptLogin(username, password) local qh = dbQuery(con, 'SELECT * FROM accounts WHERE username=?', username) local user = dbPoll(qh, 500) if user then if #user > 0 then if user['password'] == hash(sha256, password) then setElementData(client, 'loggedin', true) outputDebugString('Sikeres bejelentkezés!') else outputDebugString('Nem egyezik a jelszó!') end else outputDebugString('Nincs ilyen felhasználónév!') end else outputDebugString('Ismeretlen hiba!') end end function attemptRegister(username, password, passwordAgain, email) local qh = dbQuery(con, "SELECT * FROM accounts WHERE username=? OR password=? OR email=?", username, password, email) local user = dbPoll(qh, 500) if user then if not #user > 0 then dbExec(con, "INSERT INTO accounts SET username=?, password=?, email=?", username, hash(sha256, password), email) outputDebugString('Sikeres regisztráció!') else outputDebugString('Létező felhasználó!') end else outputDebugString('Ismeretlen hiba!') end end Client Lua local screenWidth, screenHeight = guiGetScreenSize() local page = 'http://mta/cs_accounts/html/index.html' local initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, false, false) local theBrowser = guiGetBrowser(initBrowser) local bannedStatus addEventHandler('onClientBrowserCreated', theBrowser, function() if not bannedStatus then loadBrowserURL(source, page) showCursor(true) end end) addEventHandler('onClientElementDataChange', getRootElement(), function(data, oldValue, newValue) if getElementType(source) == 'player' and data == 'loggedin' and newValue then destroyElement(initBrowser) showCursor(false) end end) addEventHandler('onClientPlayerJoin', getRootElement(), function() if triggerServerEvent('checkBannedStatus', source, getPlayerSerial(source)) then bannedStatus = true else bannedStatus = false end end) Sorry for the long HTML codes!
  2. Sziasztok! Olyan kérdésem lenne, hogy valaki tudna-e legalább útba igazítani, hogyan tudnék egy 3D pozíciónáló scriptet készíteni, mint pl. SeeMTA-n a kiegészítőknél. Válaszokat előre köszönöm.
  3. Hello guys! I would like to ask if it is possible to turn off the sound of a certain car determined by ID.
  4. Can you tell me how, or send me the script, how exactly did you add left/right/backwards movement?
  5. Sziasztok! Sikeresen átnéztem a MySQL csatlakozást, azzal nincs semmi probléma, most azzal van a gond, hogy nem hajtja végre se a login-t, regisztrációt, se a karakter létrehozást. A scripten azóta dolgozgattam. Kliens oldal: showCursor(true); setPlayerHudComponentVisible("all", false); local cameraPos = { ["camera"] = 1870.80188, -1199.45056, 77.37451; ["lookingAt"] = 1960.03711, -1199.62573, 27.18720; }; local music = "files/music.mp3"; local x, y = guiGetScreenSize(); local relX, relY = x/1920, y/1080; local panelPos = {0.4, 0.3}; local showLoginPanel = true; local panelState = 1; local textBoxNumber = 0; local textBoxPos = {0.415, 0.35}; local msg = {"", 0}; local colors = { ["background"] = tocolor(50, 50, 50, 180), ["textBox"] = tocolor(150, 150, 150, 180), ["loginButton"] = tocolor(100, 255, 100, 180), ["regButton"] = tocolor(255, 100, 100, 180), ["charSexButtonNő"] = tocolor(30, 30, 30, 180), ["charSexButtonFérfi"] = tocolor(30, 30, 30, 180), }; local rememberLogin = false; local userData = { [1] = { -- Login [1] = ""; -- Adatok [2] = ""; }, [2] = { -- Regisztráció [1] = ""; -- Felhasználónév [2] = ""; -- Jelszó [3] = ""; -- Jelszó újra [4] = ""; -- E-Mail }, [3] = { -- Karakter létrehozás [1] = ""; -- Karakternév [2] = ""; -- Karakter leírás [3] = ""; -- Karakter életkora [4] = ""; -- Karakter neme }, }; local selectedDataBox = { [1] = { [1] = false; -- Felhasználónév kiválasztva [2] = false; -- Jelszó kiválasztva }, [2] = { [1] = false; -- Felhasználónév kiválasztva [2] = false; -- Jelszó kiválasztva [3] = false; -- Jelszó újra kiválasztva [4] = false; -- E-Mail kiválasztva }, [3] = { [1] = false; -- Karakternév kiválasztva [2] = false; -- Karakter leírása kiválasztva [3] = false; -- Karakter életkora kiválasztva }, }; addEventHandler("onClientRender", root, function() if showLoginPanel then if msg then if msg[2] == 2 then dxDrawRectangle(x*panelPos[1], y*(panelPos[2])+relY*420, relX*400, relY*150, colors["loginButton"]); elseif msg[2] == 1 then dxDrawRectangle(x*panelPos[1], y*(panelPos[2])+relY*420, relX*400, relY*150, colors["regButton"]); end dxDrawText(msg[1], x*panelPos[1], y*(panelPos[2])+relY*420, x*(panelPos[1])+relX*400, y*(panelPos[2])+relY*560, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center"); end dxDrawImage(x*(panelPos[1])+relX*140, y*(panelPos[2]-0.2)+relY*70, 240/2, 240/2, "files/logo.png"); setCameraMatrix(1870.80188, -1199.45056, 77.37451, 1960.03711, -1199.62573, 27.18720, 0, 90); dxDrawRectangle(x*panelPos[1], y*panelPos[2], relX*400, relY*400, colors["background"] ) dxDrawText("LoyalMTA - Login Panel", x*panelPos[1], y*(panelPos[2]-0.05), (x*panelPos[1])+400, (y*(panelPos[2]-0.05)+40), tocolor(255, 255, 255, 255), 1.75, "arial", "center", "center" ); for i=1, textBoxNumber, 1 do dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05+(i-1)*0.06), relX*350, relY*30, colors["textBox"] ); end if panelState == 1 then local text = string.rep("*", string.len(userData[1][2])); textBoxNumber = 2; dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.25), relX*25, relY*25, colors["textBox"] ); dxDrawText("Bejelentkezési adatok mentése", x*(panelPos[1]+0.0125)+27, y*(panelPos[2]+0.25), x*(panelPos[1]+0.125)+350, y*(panelPos[2]+0.25)+25, tocolor(255, 255, 255, 255), 1.25, "arial", "left", "center" ); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.05), relX*30, relY*30, "files/usericon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.11), relX*30, relY*30, "files/keyicon.png"); if selectedDataBox[1][1] then dxDrawText(userData[1][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[1][2] then dxDrawText(userData[1][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[1][1] == false and selectedDataBox[1][2] == false then dxDrawText(userData[1][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end if rememberLogin == true then dxDrawImage(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.25), relX*25, relY*25, "files/check.png") end dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*175, relY*30, colors["loginButton"] ); dxDrawText("Bejelentkezés", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), relX*175, relY*30, colors["regButton"] ); dxDrawText("Regisztráció", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.3)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif panelState == 2 then local text = string.rep("*", string.len(userData[2][2])); local text2 = string.rep("*", string.len(userData[2][3])); textBoxNumber = 4; --[[dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.05), relX*30, relY*30, "files/usericon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.11), relX*30, relY*30, "files/keyicon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.17), relX*30, relY*30, "files/keyicon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.23), relX*30, relY*30, "files/mailicon.png");]]-- if selectedDataBox[2][1] then dxDrawText(userData[2][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][2] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][3] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][4] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][1] == false and selectedDataBox[2][2] == false and selectedDataBox[2][3] == false and selectedDataBox[2][4] == false then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*175, relY*30, colors["loginButton"] ); dxDrawText("Regisztráció", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*175, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), relX*175, relY*30, colors["regButton"] ); dxDrawText("Bejelentkezés", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif panelState == 3 then textBoxNumber = 3 if selectedDataBox[3][1] then dxDrawText(userData[3][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][2] then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][3] then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][1] == false and selectedDataBox[3][2] == false and selectedDataBox[3][3] == false then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end if userData[3][4] == "Férfi" then colors["charSexButtonFérfi"] = tocolor(100, 255, 100, 180); colors["charSexButtonNő"] = tocolor(30, 30, 30, 180); elseif userData[3][4] == "Nő" then colors["charSexButtonNő"] = tocolor(100, 255, 100, 180); colors["charSexButtonFérfi"] = tocolor(30, 30, 30, 180); elseif userData[3][4] == "" then colors["charSexButtonNő"] = tocolor(30, 30, 30, 180); colors["charSexButtonFérfi"] = tocolor(30, 30, 30, 180); end --\\ Férfi gomb dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), relX*175, relY*30, colors["charSexButtonFérfi"] ); dxDrawText("Férfi", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*175, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); --\\ Nő gomb dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.23), relX*175, relY*30, colors["charSexButtonNő"] ); dxDrawText("Nő", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*350, relY*30, colors["loginButton"] ); dxDrawText("Karakter létrehozása", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end end end); addEventHandler("onClientClick", root, function(button, state, cX, cY) if showLoginPanel then if button == "left" and state == "down" then if panelState == 1 then if cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30 then selectedDataBox[1][1] = true; selectedDataBox[1][2] = false; elseif cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30 then selectedDataBox[1][1] = false; selectedDataBox[1][2] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+175) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execLogin(userData[1][1], hash("sha512", userData[1][2])); elseif (cX > (x*(panelPos[1]+0.0125)+175) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then panelState = 3; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+25 and cY > y*(panelPos[2]+0.25) and cY < y*(panelPos[2]+0.25)+25) then if rememberLogin then rememberLogin = false; else rememberLogin = true; end end elseif panelState == 2 then if (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30) then selectedDataBox[2][1] = true; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = true; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.17) and cY < y*(panelPos[2]+0.17)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = true; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.23) and cY < y*(panelPos[2]+0.23)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+175) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execReg(userData[2][1], hash("sha512", userData[2][2]), hash("sha512", userData[2][3]), userData[2][4]); elseif (cX > (x*(panelPos[1]+0.0125)+175) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then panelState = 1; end elseif panelState == 3 then if (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30) then selectedDataBox[3][1] = true; selectedDataBox[3][2] = false; selectedDataBox[3][3] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30) then selectedDataBox[3][1] = false; selectedDataBox[3][2] = true; selectedDataBox[3][3] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.17) and cY < y*(panelPos[2]+0.17)+30) then selectedDataBox[3][1] = false; selectedDataBox[3][2] = false; selectedDataBox[3][3] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execCharMaking(userData[3][1], userData[3][2], userData[3][3], userData[3][4]); elseif cX > x*(panelPos[1]+0.0125)+175 and cY > y*(panelPos[2]+0.23) and cX < x*(panelPos[1]+0.0125)+350 and cY < y*(panelPos[2]+0.23)+30 then userData[3][4] = "Nő" elseif cX > x*(panelPos[1]+0.0125) and cY > y*(panelPos[2]+0.23) and cX < x*(panelPos[1]+0.0125)+175 and cY < y*(panelPos[2]+0.23)+30 then userData[3][4] = "Férfi" end end end end end); function writing(char) if showLoginPanel then if char then if panelState == 1 then if selectedDataBox[1][1] then if string.len(userData[1][1]) < 32 then userData[1][1] = userData[1][1]..char; end elseif selectedDataBox[1][2] then if string.len(userData[1][2]) < 32 then userData[1][2] = userData[1][2]..char; end end elseif panelState == 2 then if selectedDataBox[2][1] then if string.len(userData[2][1]) < 32 then userData[2][1] = userData[2][1]..char; end elseif selectedDataBox[2][2] then if string.len(userData[2][2]) < 32 then userData[2][2] = userData[2][2]..char; end elseif selectedDataBox[2][3] then if string.len(userData[2][3]) < 32 then userData[2][3] = userData[2][3]..char; end elseif selectedDataBox[2][4] then if string.len(userData[2][4]) < 32 then userData[2][4] = userData[2][4]..char; end end elseif panelState == 3 then if selectedDataBox[3][1] then if string.len(userData[3][1]) < 32 then userData[3][1] = userData[3][1]..char; end elseif selectedDataBox[3][2] then if string.len(userData[3][2]) < 32 then userData[3][2] = userData[3][2]..char; end elseif selectedDataBox[3][3] then if string.len(userData[3][3]) < 32 then userData[3][3] = userData[3][3]..char; end end end end end end addEventHandler("onClientCharacter", root, writing); function delAndTab(button, pOr) if showLoginPanel then if button == "tab" and pOr == true then if panelState == 1 then if selectedDataBox[1][1] then selectedDataBox[1][1] = false; selectedDataBox[1][2] = true; elseif selectedDataBox[1][2] then selectedDataBox[1][1] = true; selectedDataBox[1][2] = false; end elseif panelState == 2 then if selectedDataBox[2][1] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = true; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif selectedDataBox[2][2] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = true; selectedDataBox[2][4] = false; elseif selectedDataBox[2][3] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = true; elseif selectedDataBox[2][4] then selectedDataBox[2][1] = true; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; end elseif panelState == 3 then if selectedDataBox[3][1] then selectedDataBox[3][1] = false; selectedDataBox[3][2] = true; selectedDataBox[3][3] = false; elseif selectedDataBox[3][2] then selectedDataBox[3][1] = false; selectedDataBox[3][2] = false; selectedDataBox[3][3] = true; elseif selectedDataBox[3][3] then selectedDataBox[3][1] = true; selectedDataBox[3][2] = false; selectedDataBox[3][3] = false; end end elseif button == "backspace" and pOr == true then if panelState == 1 then if selectedDataBox[1][1] then userData[1][1] = string.sub(userData[1][1], 0, string.len(userData[1][1])-1); delTimer = setTimer(function() userData[1][1] = string.sub(userData[1][1], 0, string.len(userData[1][1])-1); end, 100, 0); elseif selectedDataBox[1][2] then userData[1][2] = string.sub(userData[1][2], 0, string.len(userData[1][2])-1); delTimer = setTimer(function() userData[1][2] = string.sub(userData[1][2], 0, string.len(userData[1][2])-1); end, 100, 0); end elseif panelState == 2 then if selectedDataBox[2][1] then userData[2][1] = string.sub(userData[2][1], 0, string.len(userData[2][1])-1); delTimer = setTimer(function() userData[2][1] = string.sub(userData[2][1], 0, string.len(userData[2][1])-1); end, 100, 0); elseif selectedDataBox[2][2] then userData[2][2] = string.sub(userData[2][2], 0, string.len(userData[2][2])-1); delTimer = setTimer(function() userData[2][2] = string.sub(userData[2][2], 0, string.len(userData[2][2])-1); end, 100, 0); elseif selectedDataBox[2][3] then userData[2][3] = string.sub(userData[2][3], 0, string.len(userData[2][3])-1); delTimer = setTimer(function() userData[2][3] = string.sub(userData[2][3], 0, string.len(userData[2][3])-1); end, 100, 0); elseif selectedDataBox[2][4] then userData[2][4] = string.sub(userData[2][4], 0, string.len(userData[2][4])-1); delTimer = setTimer(function() userData[2][4] = string.sub(userData[2][4], 0, string.len(userData[2][4])-1); end, 100, 0); end elseif panelState == 3 then if selectedDataBox[3][1] then userData[3][1] = string.sub(userData[3][1], 0, string.len(userData[3][1])-1); delTimer = setTimer(function() userData[3][1] = string.sub(userData[3][1], 0, string.len(userData[3][1])-1); end, 100, 0); elseif selectedDataBox[3][2] then userData[3][2] = string.sub(userData[3][2], 0, string.len(userData[3][2])-1); delTimer = setTimer(function() userData[3][2] = string.sub(userData[3][2], 0, string.len(userData[3][2])-1); end, 100, 0); elseif selectedDataBox[3][3] then userData[3][3] = string.sub(userData[3][3], 0, string.len(userData[3][3])-1); delTimer = setTimer(function() userData[3][3] = string.sub(userData[3][3], 0, string.len(userData[3][3])-1); end, 100, 0); end end elseif button == "backspace" and pOr == false then killTimer(delTimer); elseif button == "enter" and pOr then if panelState == 1 then execLogin(userData[1][1], hash("sha512", userData[1][2])); elseif panelState == 2 then execReg(userData[2][1], hash("sha512", userData[2][2]), hash("sha512", userData[2][3]), userData[2][4]); elseif panelState == 3 then execCharMaking(userData[3][1], userData[3][2], userData[3][3], userData[3][4]); end end end end addEventHandler("onClientKey", root, delAndTab); function execLogin(username, password) if string.len(userData[1][1]) >= 3 then if string.len(userData[1][2]) >= 3 then triggerServerEvent("execLogin", root, username, password); else notify("Rövid jelszó!", 1); end else notify("Rövid felhasználónév", 1); end end function execReg(username, password, password2, email) if string.len(userData[2][1]) >= 3 then if string.len(userData[2][2]) >= 3 then if string.len(userData[2][3]) >= 3 then if string.len(userData[2][4]) >= 6 then triggerServerEvent("execReg", root, username, password, password2, email); else notify("Rövid az email!", 1); end else notify("Rövid a második jelszó!", 1); end else notify("Rövid a jelszó!", 1); end else notify("Rövid a felhasználónév!", 1); end end function execCharMaking(charName, charLeiras, charAge, charNem) if string.len(userData[3][1]) >= 6 then if string.len(userData[3][2]) >= 6 then if string.len(userData[3][3]) >= 1 and string.len(userData[3][3]) <= 99 then if userData[3][4] then triggerServerEvent("execReg", root, charName, charLeiras, charAge, charNem); else notify("Válaszd ki a karaktered nemét!", 1); end else notify("Adj meg egy érvényes életkort a karatkerednek!", 1); end else notify("Rövid a karakterleírás!", 1); end else notify("Rövid a karakternév!", 1); end end function notify(mssg, msgType) local msgTypeColor = { [1] = tocolor(255, 100, 100, 180); [2] = tocolor(100, 255, 100, 180); }; if showLoginPanel then msg = {mssg, tonumber(msgType)}; outputConsole(mssg); end end addEventHandler("notify", root, notify); addEvent("notify", true); Szerver oldal: local con = exports.ly_connect:getConnection(); function isPlayerBanned(player) if player then local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT * FROM bans WHERE bannedSerial=? AND bannedUntil > CURRENT_TIME()", serial); local bans = dbPoll(qh, 1000); outputDebugString(#bans); if bans then if (#bans > 0) then return true; else return false; end else return false; end else return false; end end function execServerLog(username, password) outputChatBox("1") if not isPlayerBanned() then local serial = getPlayerSerial(client); local qh = dbQuery("SELECT * FROM accounts WHERE serial=?", serial); local user = dbPoll(qh, 500); if user then if #user > 0 then if user[1]["password"] == password then setElementData(client, "acc:id", user[1]["id"]); triggerClientEvent(client, "notify", root, "Sikeres bejelentkezés!", 2); spawnPlayer(0, 0, 4, 29); setCameraTarget(client, client); fadeCamera(client); else triggerClientEvent(client, "notify", root, "Nem egyezik a jelszó!", 1); end else triggerClientEvent(client, "notify", root, "Nincs létrehozva felhasználó!", 1); end else triggerClientEvent(client, "notify", root, "Ismeretlen hiba!", 1); end else outputChatBox("1") triggerClientEvent(client, "notify", root, "Bannolva vagy! Keress fel egy szuperadmint/fejlesztőt!", 1); end end addEventHandler("execLogin", root, execServerLog); addEvent("execLogin", true); function execServerReg(username, password, password2, email) if not isPlayerBanned() then local serial = getPlayerSerial(client); local qh = dbQuery("SELECT * FROM accounts WHERE serial=? OR username=? OR email=?", serial, username, email); local user = dbPoll(qh, 500); if user then if not #user > 0 then dbExec("INSERT INTO accounts SET username=?, password=?, email=?", username, password, email); triggerClientEvent(client, "notify", root, "Sikeresen létrehoztad a fiókodat!", 2); else triggerClientEvent(client, "notify", root, "Létezik felhasználó a te serialodon!", 1); end else triggerClientEvent(client, "notify", root, "Ismeretlen hiba!", 1); end else triggerClientEvent(client, "notify", root, "Bannolva vagy! Keress fel egy szuperadmint/fejlesztőt!", 1); end end addEventHandler("execReg", root, execServerReg); addEvent("execReg", true); function execCharMaking(charName, charLeiras, charAge, charNem) if not isPlayerBanned() then local serial = getPlayerSerial(client); local qh = dbQuery("SELECT * FROM accounts WHERE serial=? OR charName=?", serial, charName); local user = dbPoll(qh, 500); if user then if not #user > 0 then dbExec("INSERT INTO accounts SET charName=?, charLeiras=?, charSex=?", charName, charLeiras, charAge, charNem); triggerClientEvent(client, "notify", root, "Sikeres karakter létrehozás!", 2); else triggerClientEvent(client, "notify", root, "A karakternév foglalt!", 1); end else triggerClientEvent(client, "notify", root, "Ismeretlen hiba!", 1); end else triggerClientEvent(client, "notify", root, "Bannolva vagy! Keress fel egy szuparadmint/fejlesztőt!", 1); end end addEventHandler("execCharMake", root, execCharMaking); addEvent("execCharMake", true);
  6. A hiba forrása meglett, a szerver oldali funkciók argumentjei után raktam véletlen ;-t, viszont most egy másik probléma keletkezett.. Most valamiért a MySQL-hez nem akar csatlakozni.
  7. Sziasztok! Akadt egy olyan gondom, hogy a login panelemben amikor meg akarom hívni a szerver oldali eventeket amiket én hoztam részre, a debugscript folyamat spameli, hogy nincs létrehozva. Elég hosszúra sikeredett a script, tudom lehetett volna egyszerűbben, de na. Itt a kliens és a szerver oldali: Kliens: showCursor(true); setPlayerHudComponentVisible("all", false); local cameraPos = { ["camera"] = 1870.80188, -1199.45056, 77.37451; ["lookingAt"] = 1960.03711, -1199.62573, 27.18720; }; local music = "files/music.mp3"; local x, y = guiGetScreenSize(); local relX, relY = x/1920, y/1080; local panelPos = {0.4, 0.3}; local showLoginPanel = true; local panelState = 1; local textBoxNumber = 0; local textBoxPos = {0.415, 0.35}; local colors = { ["background"] = tocolor(50, 50, 50, 180), ["textBox"] = tocolor(150, 150, 150, 180), ["loginButton"] = tocolor(100, 255, 100, 180), ["regButton"] = tocolor(255, 100, 100, 180), ["charSexButtonNő"] = tocolor(30, 30, 30, 180), ["charSexButtonFérfi"] = tocolor(30, 30, 30, 180), }; local rememberLogin = false; local userData = { [1] = { -- Login [1] = ""; -- Adatok [2] = ""; }, [2] = { -- Regisztráció [1] = ""; -- Felhasználónév [2] = ""; -- Jelszó [3] = ""; -- Jelszó újra [4] = ""; -- E-Mail }, [3] = { -- Karakter létrehozás [1] = ""; -- Karakternév [2] = ""; -- Karakter leírás [3] = ""; -- Karakter életkora [4] = ""; -- Karakter neme }, }; local selectedDataBox = { [1] = { [1] = false; -- Felhasználónév kiválasztva [2] = false; -- Jelszó kiválasztva }, [2] = { [1] = false; -- Felhasználónév kiválasztva [2] = false; -- Jelszó kiválasztva [3] = false; -- Jelszó újra kiválasztva [4] = false; -- E-Mail kiválasztva }, [3] = { [1] = false; -- Karakternév kiválasztva [2] = false; -- Karakter leírása kiválasztva [3] = false; -- Karakter életkora kiválasztva }, }; addEventHandler("onClientRender", root, function() if showLoginPanel then local isBanned = triggerServerEvent("isPlayerBanned", localPlayer); if isBanned then panelState = 4; end dxDrawImage(x*(panelPos[1])+50, y*(panelPos[2]-0.2), 600/2, 480/2, "files/logo.png"); setCameraMatrix(1870.80188, -1199.45056, 77.37451, 1960.03711, -1199.62573, 27.18720, 0, 90); dxDrawRectangle(x*panelPos[1], y*panelPos[2], relX*400, relY*400, colors["background"] ) dxDrawText("LoyalMTA - Login Panel", x*panelPos[1], y*(panelPos[2]-0.05), (x*panelPos[1])+400, (y*(panelPos[2]-0.05)+40), tocolor(255, 255, 255, 255), 1.75, "arial", "center", "center" ); for i=1, textBoxNumber, 1 do dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05+(i-1)*0.06), relX*350, relY*30, colors["textBox"] ); end if panelState == 1 then local text = string.rep("*", string.len(userData[1][2])); textBoxNumber = 2; dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.25), relX*25, relY*25, colors["textBox"] ); dxDrawText("Bejelentkezési adatok mentése", x*(panelPos[1]+0.0125)+27, y*(panelPos[2]+0.25), x*(panelPos[1]+0.125)+350, y*(panelPos[2]+0.25)+25, tocolor(255, 255, 255, 255), 1.25, "arial", "left", "center" ); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.05), relX*30, relY*30, "files/usericon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.11), relX*30, relY*30, "files/keyicon.png"); if selectedDataBox[1][1] then dxDrawText(userData[1][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[1][2] then dxDrawText(userData[1][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[1][1] == false and selectedDataBox[1][2] == false then dxDrawText(userData[1][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.11)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end if rememberLogin == true then dxDrawImage(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.25), relX*25, relY*25, "files/check.png") end dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*175, relY*30, colors["loginButton"] ); dxDrawText("Bejelentkezés", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), relX*175, relY*30, colors["regButton"] ); dxDrawText("Regisztráció", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.3)+30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif panelState == 2 then local text = string.rep("*", string.len(userData[2][2])); local text2 = string.rep("*", string.len(userData[2][3])); textBoxNumber = 4; --[[dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.05), relX*30, relY*30, "files/usericon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.11), relX*30, relY*30, "files/keyicon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.17), relX*30, relY*30, "files/keyicon.png"); dxDrawImage(x*(panelPos[1]+0.0125)+320, y*(panelPos[2]+0.23), relX*30, relY*30, "files/mailicon.png");]]-- if selectedDataBox[2][1] then dxDrawText(userData[2][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][2] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][3] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2.."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][4] then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[2][1] == false and selectedDataBox[2][2] == false and selectedDataBox[2][3] == false and selectedDataBox[2][4] == false then dxDrawText(userData[2][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(text2, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[2][4], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*175, relY*30, colors["loginButton"] ); dxDrawText("Regisztráció", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*175, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), relX*175, relY*30, colors["regButton"] ); dxDrawText("Bejelentkezés", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif panelState == 3 then textBoxNumber = 3 if selectedDataBox[3][1] then dxDrawText(userData[3][1].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][2] then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][3] then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3].."|", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif selectedDataBox[3][1] == false and selectedDataBox[3][2] == false and selectedDataBox[3][3] == false then dxDrawText(userData[3][1], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][2], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.11), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.11)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawText(userData[3][3], x*(panelPos[1]+0.0125), y*(panelPos[2]+0.17), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.17)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end if userData[3][4] == "Férfi" then colors["charSexButtonFérfi"] = tocolor(100, 255, 100, 180); colors["charSexButtonNő"] = tocolor(30, 30, 30, 180); elseif userData[3][4] == "Nő" then colors["charSexButtonNő"] = tocolor(100, 255, 100, 180); colors["charSexButtonFérfi"] = tocolor(30, 30, 30, 180); elseif userData[3][4] == "" then colors["charSexButtonNő"] = tocolor(30, 30, 30, 180); colors["charSexButtonFérfi"] = tocolor(30, 30, 30, 180); end --\\ Férfi gomb dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), relX*175, relY*30, colors["charSexButtonFérfi"] ); dxDrawText("Férfi", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*175, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); --\\ Nő gomb dxDrawRectangle(x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.23), relX*175, relY*30, colors["charSexButtonNő"] ); dxDrawText("Nő", x*(panelPos[1]+0.0125)+175, y*(panelPos[2]+0.23), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.23)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); dxDrawRectangle(x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), relX*350, relY*30, colors["loginButton"] ); dxDrawText("Karakter létrehozása", x*(panelPos[1]+0.0125), y*(panelPos[2]+0.3), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.3)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); elseif panelState == 4 then local serial = triggerServerEvent("getPlayerSerial", root, localPlayer); local bannedReason = triggerServerEvent("getBannedReason", root, localPlayer); local bannedUntil = triggerServerEvent("getBannedUntil", root, localPlayer); local getBannedDate = triggerServerEvent("getBannedData", root, localPlayer); textBoxNumber = 4; dxDrawText("Te serialod:"..serial, x*(panelPos[1]+0.0125), y*(panelPos[2]+0.05), x*(panelPos[1]+0.0125)+relX*350, y*(panelPos[2]+0.05)+relY*30, tocolor(255, 255, 255, 255), 1.25, "arial", "center", "center" ); end end end); addEventHandler("onClientClick", root, function(button, state, cX, cY) if showLoginPanel then if button == "left" and state == "down" then if panelState == 1 then if cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30 then selectedDataBox[1][1] = true; selectedDataBox[1][2] = false; elseif cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30 then selectedDataBox[1][1] = false; selectedDataBox[1][2] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+175) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execLogin(userData[1][1], userData[1][2]); elseif (cX > (x*(panelPos[1]+0.0125)+175) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then panelState = 3; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+25 and cY > y*(panelPos[2]+0.25) and cY < y*(panelPos[2]+0.25)+25) then if rememberLogin then rememberLogin = false; else rememberLogin = true; end end elseif panelState == 2 then if (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30) then selectedDataBox[2][1] = true; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = true; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.17) and cY < y*(panelPos[2]+0.17)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = true; selectedDataBox[2][4] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.23) and cY < y*(panelPos[2]+0.23)+30) then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+175) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execReg(userData[2][1], userData[2][2], userData[2][3], userData[2][4]); elseif (cX > (x*(panelPos[1]+0.0125)+175) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then panelState = 1; end elseif panelState == 3 then if (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.05) and cY < y*(panelPos[2]+0.05)+30) then selectedDataBox[3][1] = true; selectedDataBox[3][2] = false; selectedDataBox[3][3] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.11) and cY < y*(panelPos[2]+0.11)+30) then selectedDataBox[3][1] = false; selectedDataBox[3][2] = true; selectedDataBox[3][3] = false; elseif (cX > x*(panelPos[1]+0.0125) and cX < x*(panelPos[1]+0.0125)+350 and cY > y*(panelPos[2]+0.17) and cY < y*(panelPos[2]+0.17)+30) then selectedDataBox[3][1] = false; selectedDataBox[3][2] = false; selectedDataBox[3][3] = true; end --\\ Gombok if (cX > (x*(panelPos[1]+0.0125)) and cX < (x*(panelPos[1]+0.0125)+350) and cY > (y*(panelPos[2]+0.3)) and cY < (y*(panelPos[2]+0.3)+30)) then execCharMaking(userData[3][1], userData[3][2], userData[3][3], userData[3][4]); panelState = 2; elseif cX > x*(panelPos[1]+0.0125)+175 and cY > y*(panelPos[2]+0.23) and cX < x*(panelPos[1]+0.0125)+350 and cY < y*(panelPos[2]+0.23)+30 then userData[3][4] = "Nő" elseif cX > x*(panelPos[1]+0.0125) and cY > y*(panelPos[2]+0.23) and cX < x*(panelPos[1]+0.0125)+175 and cY < y*(panelPos[2]+0.23)+30 then userData[3][4] = "Férfi" end end end end end); function writing(char) if showLoginPanel then if char then if panelState == 1 then if selectedDataBox[1][1] then if string.len(userData[1][1]) < 32 then userData[1][1] = userData[1][1]..char; end elseif selectedDataBox[1][2] then if string.len(userData[1][1]) < 32 then userData[1][2] = userData[1][2]..char; end end elseif panelState == 2 then if selectedDataBox[2][1] then if string.len(userData[2][1]) < 32 then userData[2][1] = userData[2][1]..char; end elseif selectedDataBox[2][2] then if string.len(userData[2][2]) < 32 then userData[2][2] = userData[2][2]..char; end elseif selectedDataBox[2][3] then if string.len(userData[2][3]) < 32 then userData[2][3] = userData[2][3]..char; end elseif selectedDataBox[2][4] then if string.len(userData[2][4]) < 32 then userData[2][4] = userData[2][4]..char; end end elseif panelState == 3 then if selectedDataBox[3][1] then if string.len(userData[3][1]) < 32 then userData[3][1] = userData[3][1]..char; end elseif selectedDataBox[3][2] then if string.len(userData[3][2]) < 32 then userData[3][2] = userData[3][2]..char; end elseif selectedDataBox[3][3] then if string.len(userData[3][3]) < 32 then userData[3][3] = userData[3][3]..char; end end end end end end addEventHandler("onClientCharacter", root, writing); function delAndTab(button, pOr) if showLoginPanel then if button == "tab" and pOr == true then if panelState == 1 then if selectedDataBox[1][1] then selectedDataBox[1][1] = false; selectedDataBox[1][2] = true; elseif selectedDataBox[1][2] then selectedDataBox[1][1] = true; selectedDataBox[1][2] = false; end elseif panelState == 2 then if selectedDataBox[2][1] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = true; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; elseif selectedDataBox[2][2] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = true; selectedDataBox[2][4] = false; elseif selectedDataBox[2][3] then selectedDataBox[2][1] = false; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = true; elseif selectedDataBox[2][4] then selectedDataBox[2][1] = true; selectedDataBox[2][2] = false; selectedDataBox[2][3] = false; selectedDataBox[2][4] = false; end elseif panelState == 3 then if selectedDataBox[3][1] then selectedDataBox[3][1] = false; selectedDataBox[3][2] = true; selectedDataBox[3][3] = false; elseif selectedDataBox[3][2] then selectedDataBox[3][1] = false; selectedDataBox[3][2] = false; selectedDataBox[3][3] = true; elseif selectedDataBox[3][3] then selectedDataBox[3][1] = true; selectedDataBox[3][2] = false; selectedDataBox[3][3] = false; end end elseif button == "backspace" and pOr == true then if panelState == 1 then if selectedDataBox[1][1] then userData[1][1] = string.sub(userData[1][1], 0, string.len(userData[1][1])-1); delTimer = setTimer(function() userData[1][1] = string.sub(userData[1][1], 0, string.len(userData[1][1])-1); end, 100, 0); elseif selectedDataBox[1][2] then userData[1][2] = string.sub(userData[1][2], 0, string.len(userData[1][2])-1); delTimer = setTimer(function() userData[1][2] = string.sub(userData[1][2], 0, string.len(userData[1][2])-1); end, 100, 0); end elseif panelState == 2 then if selectedDataBox[2][1] then userData[2][1] = string.sub(userData[2][1], 0, string.len(userData[2][1])-1); delTimer = setTimer(function() userData[2][1] = string.sub(userData[2][1], 0, string.len(userData[2][1])-1); end, 100, 0); elseif selectedDataBox[2][2] then userData[2][2] = string.sub(userData[2][2], 0, string.len(userData[2][2])-1); delTimer = setTimer(function() userData[2][2] = string.sub(userData[2][2], 0, string.len(userData[2][2])-1); end, 100, 0); elseif selectedDataBox[2][3] then userData[2][3] = string.sub(userData[2][3], 0, string.len(userData[2][3])-1); delTimer = setTimer(function() userData[2][3] = string.sub(userData[2][3], 0, string.len(userData[2][3])-1); end, 100, 0); elseif selectedDataBox[2][4] then userData[2][4] = string.sub(userData[2][4], 0, string.len(userData[2][4])-1); delTimer = setTimer(function() userData[2][4] = string.sub(userData[2][4], 0, string.len(userData[2][4])-1); end, 100, 0); end elseif panelState == 3 then if selectedDataBox[3][1] then userData[3][1] = string.sub(userData[3][1], 0, string.len(userData[3][1])-1); delTimer = setTimer(function() userData[3][1] = string.sub(userData[3][1], 0, string.len(userData[3][1])-1); end, 100, 0); elseif selectedDataBox[3][2] then userData[3][2] = string.sub(userData[3][2], 0, string.len(userData[3][2])-1); delTimer = setTimer(function() userData[3][2] = string.sub(userData[3][2], 0, string.len(userData[3][2])-1); end, 100, 0); elseif selectedDataBox[3][3] then userData[3][3] = string.sub(userData[3][3], 0, string.len(userData[3][3])-1); delTimer = setTimer(function() userData[3][3] = string.sub(userData[3][3], 0, string.len(userData[3][3])-1); end, 100, 0); end end elseif pOr == false then killTimer(delTimer); end end end addEventHandler("onClientKey", root, delAndTab); function execLogin(username, password) if username == "" or password == "" then if username == "" then notify("Nincs megadva felhasználónév", 1); elseif password == "" then notify("Nincs megadva jelszó", 1); end else --triggerServerEvent("execServerLog", localPlayer, username, password); notify("Bejelentkezés végrehajtva!", 2); end end function execReg(username, password, password2, email) if not password == password2 and not string.find(email, "@") and not username then if not password == password2 then notify("A két jelszó nem egyezik!", 1); elseif not string.find(email, "@") then notify("Hibás E-Mail cím!", 1); elseif not email then notify("Nincs megadva E-Mail cím", 1); elseif not username then notify("Nincs megadva felhasználónév", 1); end else --triggerServerEvent("execServerReg", localPlayer, username, password, password2, email); notify("Sikeres regisztráció!", 2); end end function execCharMaking(charName, charLeiras, charAge, charNem) if not charName and not charLeiras and not charAge and not charNem then if not charName then notify("Nincs megadva karakternév", 1); elseif not charLeiras then notify("Nincs megadva karakter leírás", 1); elseif not charAge then notify("Nincs megadva karakter életkora", 1); elseif not charNem then notify("Nincs megadva a karaktered neme", 1); end else --triggerServerEvent("execCharMaking", localPlayer, charName, charLeiras, charAge, charNem); notify("Sikeresen elkészítetted a karaktered!", 2) end end function notify(msg, msgType) local msgTypeColor = { [1] = tocolor(255, 100, 100, 180); [2] = tocolor(100, 255, 100, 180); }; if showLoginPanel then outputConsole(msg); end end Szerver: local con = exports.ly_mysql:getConnection(); function isPlayerBanned(player) if player then local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT * FROM bans WHERE bannedSerial=? AND bannedUntil > CURRENT_TIME()", serial); local bans = dbPoll(qh, 1000); if bans then if (#bans > 0) then return true; else return false; end else return false; end else return false; end end addEventHandler("isPlayerBanned", root, isPlayerBanned); addEvent("isPlayerBanned", true); function getPlayerSerial(player) local serial = getPlayerSerial(player); return serial; end addEventHandler("getPlayerSerial", root, getPlayerSerial); addEvent("getPlayerSerial", true); function getBannedReason(player); local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT bannedReason FROM bans WHERE bannedSerial=?", serial); local reason = dbPoll(qh, 1000); return reason; end addEventHandler("getBannedReason", root, getBannedReason); addEvent("getBannedReason", true); function getBannedDate(player); local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT bannedDate FROM bans WHERE bannedSerial=?", serial); end addEventHandler("getBannedDate", root, getBannedData); addEvent("getBannedDate", true); function getBannedUntil(player); local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT bannedUntil FROM bans WHERE bannedSerial=?", serial); local untilDate = dbPoll(qh, 1000); return untilDate; end addEventHandler("getBannedUntil", root, getBannedUntil); addEvent("getBannedUntil", true); function execServerLog(username, password) end function execServerReg(username, password, password2, email) end function execCharMaking(charName, charLeiras, charAge, charNem) end Akinek van kedve segíteni, és ideje elolvasni, annak megköszönöm!
  8. local vehicle; function makeVeh(player, cmd, vehID) if (vehID) then else outputChatBox("#FFFFFF[#FF4F4fHiba#FFFFFF] Használat : /makeveh [Modell ID]", player, 255, 0, 0, true ); end end addCommandHandler("makeveh", makeVeh) Worthless Cynomys youtube videói alapján el kezdtem scriptelni, már sikerült egy alap hud-ot írnom 0-ról, de valamiért itt elakadtam. A problémám kifejtve : Ha az outputChatBox végére odarakom a true-t (Ugye hogy színkódolt-e) akkor nem írja ki az üzenetet, és próbáltam úgy is, hogy kitörlöm a 255, 0, 0,-t a scriptből, de úgy sem. Valaki erre egy megoldást? (Worthless-nél a szövegen és a színkódon kívül ugyan így volt írva, és nála működött.)
×
×
  • Create New...