Guest User

Untitled

a guest
Dec 13th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1. ----
  2. --Server
  3. ----
  4. addEvent("registerAccount",true)
  5. addEventHandler("registerAccount",getRootElement(),
  6. function(username,pw1)
  7. if getAccount(username) then
  8. logIn(username,username,pw1)
  9. else
  10. addAccount(username,pw1)
  11. logIn(username,username,pw1)
  12. end
  13. end
  14. )
  15.  
  16.  
  17. ----
  18. --client
  19. ----
  20. local kacke = false
  21. local username = getPlayerName(getLocalPlayer())
  22. local screenW, screenH = guiGetScreenSize()
  23. addCommandHandler("test",
  24. function()
  25. if (kacke == false) then
  26. kacke = true
  27. showCursor(true)
  28. else
  29. kacke = false
  30. showCursor(false)
  31. end
  32. end
  33. )
  34.  
  35. addEventHandler("onClientResourceStart",getRootElement(),
  36. function()
  37. showCursor(true)
  38. accept = guiCreateButton((screenW - 192) / 2, (screenH - 47) / 1.4, 192, 47, "Accept", false)
  39.         guiSetProperty(accept, "NormalTextColour", "FFAAAAAA")
  40.         password1 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.8, 291, 37, "", false)
  41.         guiEditSetMasked(password1, true)
  42.         password2 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.6, 291, 37, "", false)
  43.         guiEditSetMasked(password2, true)
  44.         local pw1 = guiGetText(password1)
  45.         local pw2 = guiGetText(password2)
  46.         addEventHandler("onClientGUIClick",accept,accepted,false)
  47. end)
  48.  
  49. addEventHandler("onClientRender", getRootElement(),
  50.     function()
  51.         --if(kacke == true) then
  52.         dxDrawRectangle((screenW - 695) / 2, (screenH - 508) / 2, 695, 508, tocolor(95, 93, 93, 163), false)
  53.         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)
  54.         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)
  55.         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)
  56.         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)
  57.    end
  58. --end
  59. )
  60.  
  61. function accepted()
  62. if (pw1 == pw2) then
  63. acceptedlogin()
  64. else
  65. outputChatBox("Deine Passwörter stimmen nicht überein!",255,0,0)
  66. end
  67. end
  68.  
  69. function acceptedlogin()
  70. triggerServerEvent("registerAccount",getLocalPlayer(),username,pw1)
  71. end
Advertisement
Add Comment
Please, Sign In to add comment