Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenWidth, screenHeight = guiGetScreenSize()
- local registerpanel = 0
- function centerGUI ( guiElement )
- local width, height = guiGetSize ( guiElement, false )
- local x, y = ( sx / 2 - width / 2 ), ( sy / 2 - height / 2 )
- guiSetPosition ( guiElement, x, y, false )
- end
- GUIEditor = {
- tab = {},
- staticimage = {},
- tabpanel = {},
- edit = {},
- button = {},
- window = {},
- label = {}
- }
- local screenW, screenH = guiGetScreenSize()
- function loginrajz()
- feledittext = guiGetText (feledit)
- jeledittext = guiGetText (jeledit)
- dxDrawRectangle((screenW - 243) / 2, (screenH - 353) / 2, 243, 353, tocolor(0, 0, 0, 110), false)
- dxDrawRectangle(562, 208, 243, 17, tocolor(0, 0, 0, 110), false)
- dxDrawRectangle(574, 259, 221, 30, tocolor(0, 0, 0, 130), false)
- dxDrawRectangle(574, 311, 221, 30, tocolor(0, 0, 0, 130), false)
- dxDrawRectangle(574, 385, 221, 30, (isCursorInPosition(574, 385, 221, 30) and tocolor(66, 134, 244, 130) or tocolor(0, 0, 0, 130)))
- dxDrawRectangle(574, 429, 221, 30, (isCursorInPosition(574, 429, 221, 30) and tocolor(244, 65, 65, 130) or tocolor(0, 0, 0, 130)))
- dxDrawText("Üdv az #4286f4Immortal Gaming #ffffffszerverén!\nKérlek #ff6363 regisztrálj #ffffff vagy #4286f4jelentkezz be!\n\n#ffffffTovábbi jó játékot kívánunk!", 576, 481, 795, 533, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawRectangle(438, 451, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawText("Jelszó", 620, 292, 746, 311, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
- dxDrawText("#4286f4Bejelentkezés", 562, 208, 805, 224, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawText("Felhasználónév", 620, 240, 746, 259, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
- dxDrawText("Bejelentkezés", 620, 390, 746, 409, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
- dxDrawText("Regisztráció", 620, 435, 746, 454, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
- dxDrawText(feledittext, 578, 259, 799, 288, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center", false, false, false, false, false)
- dxDrawText(jeledittext, 578, 365, 799, 288, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center", false, false, false, false, false)
- showPlayerHudComponentVisible("all", false)
- end
- function editboxok(source)
- feledit = guiCreateEdit( 0.42, 0.34, 0.16, 0.033, "", true) --Felh. írás mező
- guiEditSetMaxLength ( feledit, 27 )
- guiSetAlpha(feledit, 0)
- addEvent ( "onClientRender", true )
- addEventHandler("onClientRender", root, loginrajz)
- myFont = guiCreateFont( "tahomabd.ttf", 8 )
- guiSetFont( feledit, myFont )
- jeledit = guiCreateEdit( 0.42, 0.408, 0.16, 0.033, "Jelszó", true) --Felh. írás mező
- guiEditSetMaxLength ( jeledit, 27 )
- guiSetAlpha(jeledit, 0)
- guiSetFont( jeledit, myFont )
- setCameraPosition, 1000, 1, source, 160.15, -1951.68, 50 ) -- Set the coordinates of the camera
- setCameraLookAt, 1000, 1, source, 165, -1951.68, 50 )
- setCameraMode ( source, "fixed" )
- end
- addEventHandler("onClientResourceStart", getRootElement(), editboxok)
- function isCursorInPosition(rectX, rectY, rectW, rectH)
- local cursorX, cursorY = getCursorPosition()
- cursorX, cursorY = cursorX * screenWidth, cursorY * screenHeight
- return (cursorX >= rectX and cursorX <= rectX+rectW) and (cursorY >= rectY and cursorY <= rectY+rectH)
- end
- function isCursorWithin(x, y, width, height)
- if(not isCursorShowing()) then
- return false;
- end
- local sx, sy = guiGetScreenSize();
- local cx, cy = getCursorPosition();
- local cx, cy = (cx*sx), (cy*sy);
- if(cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
- return true;
- else
- return false;
- end
- end
- addEvent("showHide",true)
- function showHide()
- if guiGetVisible(GUIEditor.window[1]) == true then
- guiSetVisible(GUIEditor.window[1],false)
- showCursor(false)
- elseif guiGetVisible(GUIEditor.window[1]) == false then
- guiSetVisible(GUIEditor.window[1],true)
- showCursor(true)
- end
- end
- addEventHandler("showHide",getLocalPlayer(),showHide)
- showHide()
- function buttonClick()
- if source == GUIEditor.button[2] then
- local username = guiGetText(GUIEditor.edit[4])
- local password = guiGetText(GUIEditor.edit[5])
- local email = guiGetText(GUIEditor.edit[6])
- triggerServerEvent("registerRequest",getLocalPlayer(),getLocalPlayer(),username,password,email)
- elseif source == GUIEditor.button[1] then
- local username = guiGetText(GUIEditor.edit[1])
- local password = guiGetText(GUIEditor.edit[2])
- triggerServerEvent("loginRequest",getLocalPlayer(),getLocalPlayer(),username,password)
- end
- end
- addEventHandler("onClientGUIClick",GUIEditor.window[1],buttonClick)
- function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
- if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
- return true
- else
- return false
- end
- end
- function loginBoxClick(button, state, x, y, wx, wy, wz, element)
- if (state == "down") then
- if dobozbaVan(574, 385, 221, 30, x, y) then
- local username = feledittext
- local password = jeledittext
- triggerServerEvent("loginRequest",getLocalPlayer(),getLocalPlayer(),username,password)
- end
- if dobozbaVan(574, 429, 221, 30, x, y) then
- addEventHandler("onClientRender", root, register)
- removeEventHandler("onClientRender", root, loginrajz)
- removeEventHandler("onClientResourceStart", getRootElement(), editboxok)
- addEventHandler("onClientResourceStart", getRootElement(), login)
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), loginBoxClick)
- function register()
- dxDrawRectangle((screenW - 244) / 2, (screenH - 354) / 2, 244, 321, tocolor(0, 0, 0, 110), false)
- dxDrawRectangle(562, 208, 243, 17, tocolor(0, 0, 0, 110), false)
- dxDrawRectangle(574, 259, 221, 30, tocolor(0, 0, 0, 130), false)
- dxDrawRectangle(574, 309, 221, 30, tocolor(0, 0, 0, 130), false)
- dxDrawRectangle(574, 363, 221, 30, tocolor(0, 0, 0, 130), false)
- dxDrawText("#4286f4Regisztráció", 561, 208, 805, 225, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawText("Felhasználónév", 561, 242, 805, 259, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawText("E-mail", 561, 292, 805, 309, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawText("Jelszó", 562, 346, 806, 363, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawRectangle(574, 432, 221, 30, (isCursorInPosition(574, 432, 221, 30) and tocolor(66, 134, 244, 130) or tocolor(0, 0, 0, 130)))
- dxDrawText("Regisztráció", 574, 432, 795, 462, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- dxDrawText("A regisztrációval automatikusan\n#ff6363elfogadod #ffffff a szerver szabályzatát!", 574, 472, 795, 502, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement