Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEvent("registerAccount",true)
- addEventHandler("registerAccount",getRootElement(), function(username,pw1)
- if getAccount(username) then
- logIn(getAccount(username),username,pw1)
- else
- addAccount(username,pw1)
- logIn(getAccount(username),username,pw1)
- end
- end)
- ----
- --client
- ----
- local kacke = false
- local username = getPlayerName(getLocalPlayer())
- local screenW, screenH = guiGetScreenSize()
- addCommandHandler("test", function()
- if (kacke == false) then
- kacke = true
- showCursor(true)
- else
- kacke = false
- showCursor(false)
- end
- end)
- addEventHandler("onClientResourceStart",getRootElement(), function()
- showCursor(true)
- accept = guiCreateButton((screenW - 192) / 2, (screenH - 47) / 1.4, 192, 47, "Accept", false)
- guiSetProperty(accept, "NormalTextColour", "FFAAAAAA")
- password1 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.8, 291, 37, "", false)
- guiEditSetMasked(password1, true)
- password2 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.6, 291, 37, "", false)
- guiEditSetMasked(password2, true)
- local pw1 = guiGetText(password1)
- local pw2 = guiGetText(password2)
- addEventHandler("onClientGUIClick",accept,accepted,false)
- end)
- addEventHandler("onClientRender", getRootElement(),
- function()
- --if(kacke == true) then
- dxDrawRectangle((screenW - 695) / 2, (screenH - 508) / 2, 695, 508, tocolor(95, 93, 93, 163), false)
- dxDrawText("Login/Register", (screenW - 364) / 2, (screenH - 45) / 3.5, ((screenW - 364) / 2) + 364, ( (screenH - 45) / 3.5) + 45, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
- dxDrawText("Your Name", (screenW - 190) / 2, (screenH - 30) / 2.8, ((screenW - 190) / 2) + 190, ( (screenH - 30) / 2.8) + 30, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
- dxDrawText(username, (screenW - 198) / 2, (screenH - 36) / 2.5, ((screenW - 198) / 2) + 198, ( (screenH - 36) / 2.5) + 36, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, false, false, false)
- dxDrawText("Password", (screenW - 190) / 2, (screenH - 30) / 2, ((screenW - 190) / 2) + 190, ( (screenH - 30) / 2) + 30, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
- end
- --end
- )
- function accepted()
- if (pw1 == pw2) then
- acceptedlogin()
- else
- outputChatBox("Deine Passwörter stimmen nicht überein!",255,0,0)
- end
- end
- function acceptedlogin()
- triggerServerEvent("registerAccount",getLocalPlayer(),username,pw1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement