dxDrawRectangle(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 200)) -- username boxdxDrawRectangle(800/oX*zX, 460/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 200)) -- password boxuserbox = guiCreateEdit(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false, nil)guiSetAlpha(userbox, 0)userbox_value = guiGetText(userbox)dxDrawText(userbox_value, 800/oX*zX, 400/oY*zY, _, _, _, 2, \"default\", \"left\", \"top\")
-----------------------------------------------|---- ACCOUNT SYSTEM BY: JOHN LABELMAKER || HD -|-----------------------------------------------| ----Extend Gaming MOD Scripted By HD-----------|-----------------------------------------------|myFont = dxCreateFont(\"fonts/accfont.ttf\", 20)oX, oY = 1920, 1080function togArrow()showCursor(not isCursorShowing())endbindKey(\"M\", \"down\", togArrow) function onStart()addEventHandler(\"onClientRender\", getRootElement(), renderLogin)endaddEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), onStart)addEventHandler(\"onClientPlayerJoin\", getRootElement(), onStart) function renderLogin()local zX, zY = guiGetScreenSize()dxDrawRectangle(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 200)) -- username boxdxDrawRectangle(800/oX*zX, 460/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 200)) -- password boxuserbox = guiCreateEdit(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false, nil)guiSetAlpha(userbox, 0)userbox_value = guiGetText(userbox)dxDrawText(userbox_value, 800/oX*zX, 400/oY*zY, _, _, _, 2, \"default\", \"left\", \"top\")end
userbox = guiCreateEdit(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false, nil)guiSetAlpha(userbox, 0)
function loginMySql()connection = dbConnect(\"mysql\", \"127.0.0.1\", \"root\", \"\") if connection thenoutputDebugString(\"A mysql kapcsolat sikeresen létrejött!\", 3, 0, 255, 0) else outputDebugString(\"A mysql kapcsolat nem jött létre!\", 3, 255, 0, 0) endendaddEventHandler(\"onResourceStart\", getRootElement(), loginMySql) function loginServer(thePlayer, username, password) password = md5(password) qh = dbQuery(connection, \"SELECT * FROM accounts WHERE username = ? AND password = ? LIMIT 1\", username, password) loginResult = dbPoll(qh, -1) if loginResult > 0 then for _, row in ipairs(loginResult) do if row[\"mtaserial\"] ~= getPlayerSerial(player) then if row[\"mtaserial\"] == \"0\" then dbExec(connection, \"UPDATE accounts SET mtaserial = ? WHERE id = ?\", getPlayerSerial(player), row[\"id\"]) else outputChatBox(\"Nem az ön gépéhez van társítva ez a felhasználó\") return end else local accId = tonumber(row[\"id\"]) setElementData(player, \"acc:id\", accId) setElementData(player, \"acc:name\", tostring(row[\"name\"])) setElementData(player, \"acc:admin\", tonumber(row[\"admin\"]) or 0) setElementData(player, \"acc:aseged\", tonumber(row[\"aseged\"]) or 0) setElementData(player, \"acc:regdate\", row[\"regdate\"]) setElementData(player, \"acc:lastlogin\", row[\"lastlogin\"]) dbExec(connection, \"UPDATE accounts SET lastlogin = NOW(), online = \'1\' WHERE id = ?\", accId) end end else outputChatBox(\"A felhasználónév/jelszó nem helyes.\")endaddEvent(\"onLoginClick\", true)addEventHandler(\"onLoginClick\", getRootElement(), loginServer)function registerServer(thePlayer, username, password) local password = md5(password) local registerQuery = dbPoll(dbQuery(connection, \"SELECT * FROM accounts\"), -1) for _, row in ipairs(registerQuery) do if row[\"username\"] == username then outputChatBox(\"A felhasználónév már foglalt.\") return end if row[\"mtaserial\"] == getPlayerSerial(player) and not serials[getPlayerSerial(player)] then outputChatBox(\"Ez a serial már társítva van egy felhasználóhoz.\") return endendlocal registerInsert = dbQuery(connection, \"INSERT INTO accounts SET username = ?, password = ?, mtaserial = ?, ip = ?, regdate = NOW(), lastlogin = NOW()\",username, password, getPlayerSerial(player), getPlayerIP(player))local result, num, insertID = dbPoll(registerInsert, -1)if insertID then outputChatBox(\"Sikeresen regisztráltál! Jelentkezz be.\") --exports.mta_notifications:createNotification(player, \"Sikeresen létrehoztad a felhasználódat. Jelentkezz be\", 1) setElementData(player, \"acc:id\", insertID) --outputChatBox(insertID) --checkCharacter(player) endendendaddEvent(\"onRegisterClick\", true)addEventHandler(\"onRegisterClick\", getRootElement(), registerServer)
-----------------------------------------------|---- ACCOUNT SYSTEM BY: JOHN LABELMAKER || HD -|-----------------------------------------------| ---- Hunter Life MTA MOD Scripted By HD--------|-----------------------------------------------|panelState = \"1\"inputsOn = falseloginRendered = falsemyFont = guiCreateFont(\"fonts/accfont.ttf\", 13)myFontDx = dxCreateFont(\"fonts/accfont.ttf\", 13)oX, oY = 1920, 1080zX, zY = guiGetScreenSize()function togArrow()showCursor(not isCursorShowing())endbindKey(\"M\", \"down\", togArrow) function onStart()addEventHandler(\"onClientRender\", getRootElement(), renderLogin)input1_show = guiCreateLabel(805/oX*zX, 406.3/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false)guiLabelSetColor(input1_show, 255, 255, 255)guiSetFont(input1_show, myFont)input1 = guiCreateEdit(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false)guiSetAlpha(input1, 0)guiEditSetMaxLength(input1, 30) addEventHandler(\"onClientGUIChanged\", input1, changeTextOnKeyUser)input2_show = guiCreateLabel(805/oX*zX, 467.2/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false)guiLabelSetColor(input2_show, 255, 255, 255)guiSetFont(input2_show, myFont)input2 = guiCreateEdit(800/oX*zX, 460/oY*zY, 300/oX*zX, 35/oY*zY, \"\", false)guiSetAlpha(input2, 0)guiEditSetMaxLength(input2, 30)showCursor(true)addEventHandler(\"onClientGUIChanged\", input2, changeTextOnKeyPass) showPlayerHudComponent(\"radar\", false) setElementDimension(getLocalPlayer(), 9999)setElementAlpha(getLocalPlayer(), 0)showChat(false) setCameraMatrix(2493.72266, -1628, 50.34375, 2493.72266, -1668.54333, 13.34375, 0, 180) endaddEventHandler(\"onClientResourceStart\", getRootElement(), onStart)addEventHandler(\"onClientPlayerJoin\", getRootElement(), onStart) function renderLogin()local zX, zY = guiGetScreenSize()dxDrawRectangle(800/oX*zX, 400/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 255)) -- username boxdxDrawRectangle(800/oX*zX, 460/oY*zY, 300/oX*zX, 35/oY*zY, tocolor(0, 0, 0, 255)) -- password boxdxDrawRectangle(875/oX*zX, 520/oY*zY, 150/oX*zX, 35/oY*zY, tocolor(28, 104, 1, 255)) -- Login ButtondxDrawRectangle(875/oX*zX, 560/oY*zY, 150/oX*zX, 35/oY*zY, tocolor(96, 0, 0, 255)) -- Register ButtondxDrawText(\"Bejelentkezés\", 890/oX*zX, 528/oY*zY, 150/oX*zX, 35/oY*zY, _, _, 1, myFontDx, \"left\", \"top\")dxDrawText(\"Regisztráció\", 896/oX*zX, 568/oY*zY, 150/oX*zX, 35/oY*zY, _, _, 1, myFontDx, \"left\", \"top\")loginRendered = trueend function changeTextOnKeyUser()local newText = guiGetText(input1)guiSetText(input1_show, newText)end function changeTextOnKeyPass()local newText = guiGetText(input2)guiSetText(input2_show, newText)endfunction dobozbaVan(dX, dY, dSZ, dM, eX, eY)if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return trueelse return falseendendfunction isCursorOnBox(xS,yS,wS,hS)if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false endend endfunction loginBoxClick(button, state, x, y, wx, wy, wz, element) if PanelState and button and button == \"left\" and state and state == \"down\" then for i = 2, 4 do if dobozbaVan(875/oX*zX, 520/oY*zY, 150/oX*zX, 35/oY*zY, x, y) then username = guiGetText(input1) password = guiGetText(input2) triggerServerEvent(\"onLoginClick\", getRootElement(), thePlayer, username, password) end end endendaddEventHandler(\"onClientClick\", getRootElement(), loginBoxClick)function registerBoxClick(button, state, x, y, wx, wy, wz, element) if PanelState and button and button == \"left\" and state and state == \"down\" then for i = 2, 4 do if dobozbaVan(896/oX*zX, 568/oY*zY, 150/oX*zX, 35/oY*zY, x, y) then username = guiGetText(input1) password = guiGetText(input2) triggerServerEvent(\"onRegisterClick\", getRootElement(), thePlayer, username, password) end end endendaddEventHandler(\"onClientClick\", getRootElement(), registerBoxClick)
setElementData(player, \"acc:id\", accId)
Hol lenne ez publikálva?? Lehet, hogy kiraktam régen segítségkérésbe a HDmaster0702 accomon. Egyébként nem ír semmilyen hibát. Ha rákattintok a dx-es gombra, akkor nem csinálja meg a regisztráció/login szerver eventet.
--exports.mta_notifications:createNotification(player, \"Sikeresen létrehoztad a felhasználódat. Jelentkezz be\", 1)
local registerInsert = dbQuery(connection, \"INSERT INTO accounts SET username = ?, password = ?, mtaserial = ?, ip = ?, regdate = NOW(), lastlogin = NOW()\",
if row[\"mtaserial\"] == getPlayerSerial(player) and not serials[getPlayerSerial(player)] then outputChatBox(\"Ez a serial már társítva van egy felhasználóhoz.\") return