SHARE
TWEET

Untitled

a guest May 25th, 2019 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     @author FusioN.
  3.     @name LOGIN
  4.     @server RP
  5.     @type CLIENT
  6. ]]
  7.  
  8. Login = {
  9.     blur = nil,
  10.  
  11.     animations = {
  12.         {"dancing", "bd_clap"},
  13.         {"dancing", "bd_clap1"},
  14.         {"dancing", "dance_loop"},
  15.         {"dancing", "dan_down_a"},
  16.         {"dancing", "dan_left_a"},
  17.         {"dancing", "dan_right_a"},
  18.         {"dancing", "dan_loop_a"},
  19.         {"dancing", "dan_up_a"},
  20.     },
  21.    
  22.     main = {
  23.         gui = {},
  24.     },
  25.    
  26.     characters = {
  27.         camera = {1544.15015, -1353.22827, 332},
  28.        
  29.         positions = {
  30.             {1544.16248, -1360.45654, 329.46210, 0},
  31.             {1552.43701, -1360.25342, 329.46930, 45},
  32.             {1552.57837, -1353.36621, 329.46054, 90},
  33.             {1552.39600, -1346.30188, 329.45917, 135},
  34.             {1544.21411, -1346.09070, 329.46255, 180},
  35.             {1536.93860, -1346.21118, 329.46481, 225},
  36.             {1536.76855, -1353.15527, 329.45895, 270},
  37.             {1536.79858, -1360.21411, 329.46060, 315},
  38.         },
  39.        
  40.         creating = false,
  41.         skins = {
  42.             ["male"] = {
  43.                 ["black"] = {7, 14, 17, 18, 19, 20, 21, 22, 24, 25, 28, 35, 36, 46, 47, 48, 66, 67, 80, 83, 84, 98, 102, 103, 104, 105, 106, 107, 134, 136, 142, 143, 144, 156, 166, 168, 176, 180, 182, 183, 185, 220, 221, 222, 223,  241, 249, 262, 269, 270, 271, 293, 296, 297, 300, 301, 302, 310, 311},
  44.                 ["white"] = {1, 2, 23, 26, 29, 30, 32, 33, 34, 37, 44, 45,  49, 50, 59, 60, 62, 68, 72, 73, 81, 94, 95, 96, 97, 100, 101, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 133, 135, 137,  146, 147, 154, 158, 159, 160, 161, 162, 165, 170, 171, 173, 174, 175, 177, 179, 181, 184, 187, 188, 189, 202, 206, 210, 212, 213, 217, 227, 228, 229, 230, 234, 235, 236, 239, 240, 242, 247, 248, 250, 254, 258, 259, 261, 264, 268, 272, 290, 291, 292, 295, 299,  303, 305, 306, 307, 308},
  45.                 ["asian"] = {44, 166, 294},
  46.             },
  47.             ["female"] = {
  48.                 ["black"] = {9, 13},
  49.                 ["white"] = {11, 12},
  50.                 ["asian"] = {40},
  51.             },
  52.         },
  53.        
  54.         gui = {},
  55.         create_gui = {},
  56.     }
  57. }
  58.  
  59. Login.render = function()
  60.     if Login.blur then Login.blur:Render(0, 0, sW, sH) end
  61.     setTime(0, 0)
  62.    
  63.     for i, v in ipairs(Login.main.gui) do v:Render() end
  64.     for i, v in ipairs(Login.characters.gui) do v:Render() end
  65.     for i, v in ipairs(Login.characters.create_gui) do v:Render() end
  66. end
  67.  
  68. Login.start = function()
  69.     if getElementData(localPlayer, "p:logged") then return end
  70.    
  71.     setPlayerHudComponentVisible("all", false)
  72.     showChat(false)
  73.     showCursor(true)
  74.     setFarClipDistance(2000)
  75.     setCameraMatrix(2650.740234375,-2669.0166015625,885.70837402344, 1615.759765625,-1622.94140625,255.43676757813)
  76.     setTime(0, 0)
  77.     fadeCamera(true)
  78.     addEventHandler("onClientRender", root, Login.render)
  79.    
  80.     Login.blur = Blur()
  81.     Noti.max_height = scale(300)
  82.    
  83.     -- MAIN
  84.    
  85.     Login.main.gui[1] = Image(scale(10), (sH / 2) - scale(270), scale(500), scale(500), "images/delta_rp.png", {255, 255, 255, 255}, false)
  86.    
  87.     Login.main.gui[2] = Window(sW - scale(700), (sH / 2) - scale(165), scale(600), scale(250), "WITAJ NA DELTARP", false, false)
  88.     Login.main.gui[2]:Set("bar_align", "center")
  89.    
  90.     Login.main.gui[3] = Edit(sW - scale(650), (sH / 2) - scale(95), scale(500), scale(40), "NAZWA UŻYTKOWNIKA", false)
  91.     Login.main.gui[3]:Set("icon", {"user", "solid"})
  92.     Login.main.gui[3]:Set("max_characters", 30)
  93.     Login.main.gui[3]:Set("allowed", {["a"] = true, ["b"] = true, ["c"] = true, ["d"] = true, ["e"] = true, ["f"] = true, ["g"] = true, ["h"] = true, ["i"] = true, ["j"] = true, ["k"] = true, ["l"] = true, ["m"] = true, ["n"] = true, ["o"] = true, ["p"] = true, ["q"] = true, ["r"] = true, ["s"] = true, ["t"] = true, ["u"] = true, ["v"] = true, ["w"] = true, ["x"] = true, ["y"] = true, ["z"] = true, ["A"] = true, ["B"] = true, ["C"] = true, ["D"] = true, ["E"] = true, ["F"] = true, ["G"] = true, ["H"] = true, ["I"] = true, ["J"] = true, ["K"] = true, ["L"] = true, ["M"] = true, ["N"] = true, ["O"] = true, ["P"] = true, ["Q"] = true, ["R"] = true, ["S"] = true, ["T"] = true, ["U"] = true, ["V"] = true, ["W"] = true, ["X"] = true, ["Y"] = true, ["Z"] = true, ["1"] = true, ["2"] = true, ["3"] = true, ["4"] = true, ["5"] = true, ["6"] = true, ["7"] = true, ["8"] = true, ["9"] = true, ["0"] = true,})
  94.    
  95.     Login.main.gui[4] = Edit(sW - scale(650), (sH / 2) - scale(45), scale(500), scale(40), "HASŁO", false)
  96.     Login.main.gui[4]:Set("icon", {"lock", "solid"})
  97.     Login.main.gui[4]:Set("mask_on_click", true)
  98.     Login.main.gui[4]:Set("max_characters", 30)
  99.     Login.main.gui[4]:Set("allowed", {["a"] = true, ["b"] = true, ["c"] = true, ["d"] = true, ["e"] = true, ["f"] = true, ["g"] = true, ["h"] = true, ["i"] = true, ["j"] = true, ["k"] = true, ["l"] = true, ["m"] = true, ["n"] = true, ["o"] = true, ["p"] = true, ["q"] = true, ["r"] = true, ["s"] = true, ["t"] = true, ["u"] = true, ["v"] = true, ["w"] = true, ["x"] = true, ["y"] = true, ["z"] = true, ["A"] = true, ["B"] = true, ["C"] = true, ["D"] = true, ["E"] = true, ["F"] = true, ["G"] = true, ["H"] = true, ["I"] = true, ["J"] = true, ["K"] = true, ["L"] = true, ["M"] = true, ["N"] = true, ["O"] = true, ["P"] = true, ["Q"] = true, ["R"] = true, ["S"] = true, ["T"] = true, ["U"] = true, ["V"] = true, ["W"] = true, ["X"] = true, ["Y"] = true, ["Z"] = true, ["1"] = true, ["2"] = true, ["3"] = true, ["4"] = true, ["5"] = true, ["6"] = true, ["7"] = true, ["8"] = true, ["9"] = true, ["0"] = true, ["!"] = true, ["@"] = true, ["#"] = true, ["$"] = true, ["%"] = true, ["^"] = true, ["&"] = true, ["*"] = true, ["("] = true, [")"] = true, ["["] = true, ["]"] = true, ["{"] = true, ["}"] = true, [";"] = true, [":"] = true, ["'"] = true, ['"'] = true, ["|"] = true, ["<"] = true, [">"] = true, [","] = true, ["."] = true, ["/"] = true, ["?"] = true, ["-"] = true, ["_"] = true, ["="] = true, ["+"] = true})
  100.    
  101.     Login.main.gui[5] = Check(sW - scale(645), (sH / 2) + scale(10), scale(490), scale(30), "ZAPAMIĘTAJ MNIE", false)
  102.     Login.main.gui[5]:Set("align", "right")
  103.  
  104.     Login.main.gui[6] = Button(sW - scale(650), (sH / 2) + scale(55), scale(245), scale(45), "UTWÓRZ KONTO", false)
  105.     Login.main.gui[6]:Set("onClick", function(key, state)
  106.         if key ~= "left" or state ~= "down" then return end
  107.         local username = Login.main.gui[3]:Get("text")
  108.         local password = Login.main.gui[4]:Get("text")
  109.        
  110.         if username == Login.main.gui[3]:Get("placeholder") or password == Login.main.gui[4]:Get("placeholder") then return end
  111.         if utf8.len(username) < 3 then localPlayer:Notification("Twoja nazwa użytkownika musi mieć przynajmniej 3 znaki!", "error") return end
  112.         if utf8.len(username) > 30 then localPlayer:Notification("Twoja nazwa użytkownika może mieć maksymalnie 30 znaków!", "error") return end
  113.         if utf8.len(password) < 3 then localPlayer:Notification("Twoje hasło musi mieć przynajmniej 3 znaki!", "error") return end
  114.         if utf8.len(password) > 30 then localPlayer:Notification("Twoje hasło może mieć maksymalnie 30 znaków!", "error") return end
  115.        
  116.         triggerServerEvent("Login.register", resourceRoot, username, password)
  117.     end)
  118.    
  119.     Login.main.gui[7] = Button(sW - scale(395), (sH / 2) + scale(55), scale(245), scale(45), "ZALOGUJ SIĘ", false)
  120.     Login.main.gui[7]:Set("onClick", function(key, state)
  121.         if key ~= "left" or state ~= "down" then return end
  122.         local username = Login.main.gui[3]:Get("text")
  123.         local password = Login.main.gui[4]:Get("text")
  124.        
  125.         if username == Login.main.gui[3]:Get("placeholder") or password == Login.main.gui[4]:Get("placeholder") then return end
  126.         if utf8.len(username) < 3 then localPlayer:Notification("Twoja nazwa użytkownika musi mieć przynajmniej 3 znaki!", "error") return end
  127.         if utf8.len(username) > 30 then localPlayer:Notification("Twoja nazwa użytkownika może mieć maksymalnie 30 znaków!", "error") return end
  128.         if utf8.len(password) < 3 then localPlayer:Notification("Twoje hasło musi mieć przynajmniej 3 znaki!", "error") return end
  129.         if utf8.len(password) > 30 then localPlayer:Notification("Twoje hasło może mieć maksymalnie 30 znaków!", "error") return end
  130.        
  131.         triggerServerEvent("Login.login", resourceRoot, username, password)
  132.        
  133.         if Login.main.gui[5]:Get("selected") then
  134.             local file_existing = fileExists("@passwords.json")
  135.             local file
  136.             if not file_existing then file = fileCreate("@passwords.json") else file = fileOpen("@passwords.json") end
  137.            
  138.             local data = toJSON({username = Login.main.editboxes[1].text, password = teaEncode(Login.main.editboxes[2].text, "8AIPfRixv3AXGtUV")})
  139.             fileWrite(file, data)
  140.             fileClose(file)
  141.         end
  142.     end)
  143.    
  144.     Utility.alpha(Login.main.gui, 0)
  145.     Utility.visible(Login.main.gui)
  146.    
  147.     -- CHARACTERS
  148.    
  149.     Login.characters.gui[1] = Button((sW / 2) - scale(635), sH - scale(50), scale(250), scale(40), "", false)
  150.     Login.characters.gui[1]:Set("icon", {"angle-double-left", "solid"})
  151.    
  152.     Login.characters.gui[2] = Button((sW / 2) - scale(380), sH - scale(50), scale(250), scale(40), "WYBIERZ POSTAĆ", false)
  153.  
  154.     Login.characters.gui[3] = Rectangle((sW / 2) - scale(125), sH - scale(50), scale(250), scale(40), {30, 30, 30, 105}, false)
  155.     Login.characters.gui[3]:Set("border", {20, 20, 20, 105, 1})
  156.     Login.characters.gui[4] = Text("NAZWA POSTACI", (sW / 2) - scale(125), sH - scale(50), scale(250), scale(40), {255, 255, 255, 255}, 1/zoom, getFont("regular", 17), "center", "center", false, false, false, false, false)
  157.  
  158.     Login.characters.gui[5] = Button((sW / 2) + scale(130), sH - scale(50), scale(250), scale(40), "STWÓRZ POSTAĆ", false)
  159.    
  160.     Login.characters.gui[6] = Button((sW / 2) + scale(385), sH - scale(50), scale(250), scale(40), "", false)
  161.     Login.characters.gui[6]:Set("icon", {"angle-double-right", "solid"})
  162.    
  163.     Utility.alpha(Login.characters.gui, 0)
  164.     Utility.visible(Login.characters.gui)
  165.    
  166.     -- CREATING
  167.    
  168.     Login.characters.create_gui[1] = Window(0, (sH / 2) - scale(155), scale(500), scale(230), "INFORMACJE", false, false)
  169.     Login.characters.create_gui[1]:Set("bar_align", "right")
  170.    
  171.     Login.characters.create_gui[2] = Edit(0, (sH / 2) - scale(105), scale(500), scale(40), "IMIĘ", false, false)
  172.     Login.characters.create_gui[3] = Edit(0, (sH / 2) - scale(60), scale(500), scale(40), "NAZWISKO", false, false)
  173.     Login.characters.create_gui[4] = Edit(0, (sH / 2) - scale(15), scale(500), scale(40), "WIEK", false, false)
  174.     Login.characters.create_gui[5] = Edit(0, (sH / 2) + scale(30), scale(500), scale(40), "WZROST", false, false)
  175.     Login.characters.create_gui[6] = Edit(0, (sH / 2) + scale(75), scale(500), scale(40), "WAGA", false, false)
  176.    
  177.     Login.characters.create_gui[7] = Window(sW - scale(500), (sH / 2) - scale(155), scale(500), scale(230), "WYGLĄD", false, false)
  178.     Login.characters.create_gui[7]:Set("bar_align", "left")
  179.    
  180.     Login.characters.create_gui[8] = Grid(sW - scale(500), (sH / 2) - scale(140), scale(500), scale(200), false)
  181.     Login.characters.create_gui[8]:Set("title", false)
  182.     Login.characters.create_gui[8].column = Login.characters.create_gui[8]:AddColumn("RASA", 1)
  183.     Login.characters.create_gui[8].column:AddRow("BIAŁA")
  184.     Login.characters.create_gui[8].column:AddRow("CZARNA")
  185.     Login.characters.create_gui[8].column:AddRow("ŻÓŁTA")
  186.    
  187.     Login.characters.create_gui[9] = Grid(sW - scale(500), (sH / 2) - scale(37.5), scale(500), scale(200), false)
  188.     Login.characters.create_gui[9]:Set("title", false)
  189.     Login.characters.create_gui[9].column = Login.characters.create_gui[9]:AddColumn("PLEC", 1)
  190.     Login.characters.create_gui[9].column:AddRow("MĘŻCZYZNA")
  191.     Login.characters.create_gui[9].column:AddRow("KOBIETA")
  192.    
  193.     Login.characters.create_gui[10] = Button(sW - scale(500), (sH / 2) + scale(75), scale(40), scale(40), "", false)
  194.     Login.characters.create_gui[10]:Set("icon", {"angle-double-left", "solid"})
  195.    
  196.     Login.characters.create_gui[11] = Rectangle(sW - scale(460), (sH / 2) + scale(75), scale(420), scale(40), {30, 30, 30, 204}, false)
  197.     Login.characters.create_gui[11]:Set("alpha", 0.7)
  198.     Login.characters.create_gui[12] = Text("SKIN ID: 0", sW - scale(460), (sH / 2) + scale(75), scale(420), scale(40), {255, 255, 255, 255}, 1/zoom, getFont("regular", 17), "center", "center", false, false, false, false, false)
  199.    
  200.     Login.characters.create_gui[13] = Button(sW - scale(40), (sH / 2) + scale(75), scale(40), scale(40), "", false)
  201.     Login.characters.create_gui[13]:Set("icon", {"angle-double-right", "solid"})
  202.    
  203.     Utility.alpha(Login.characters.create_gui, 0)
  204.     Utility.visible(Login.characters.create_gui)
  205.    
  206.     --
  207.    
  208.     Utility.visible(Login.main.gui)
  209.    
  210.     Animation(0, 1, "InQuad", 500, function(a)
  211.         Utility.alpha(Login.main.gui, a)
  212.     end)
  213. end
  214. addEventHandler("onClientResourceStart", resourceRoot, Login.start)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top