Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEvent("logging:alert", true)
- addEvent("logging:successful", true)
- edit=exports.editbox
- local sx,sy = guiGetScreenSize()
- local fh = 1920
- if sx < fh then
- zoom = math.min(2,fh/sx)
- else
- zoom = 1
- end
- Blur = {}
- local shader = false
- local renderTarget = false
- local screenSource = false
- local screenWidth, screenHeight = guiGetScreenSize()
- local blurStrength = 6
- local saturation = 1.0
- local brightness = 0.6
- local contrast = 1.0
- local testMode = "false"
- local function wordWrap(str, limit)
- limit = limit or 80
- local here = 1
- return ""..str:gsub("(%s+)()(%S+)()",
- function(sp, st, word, fi)
- if fi-here > limit then
- here = st
- return "\n"..word
- end
- end)
- end
- local sm = {}
- sm.moov = 0
- object1,object2 = nil,nil
- local function removeCamHandler()
- if(sm.moov == 1)then
- sm.moov = 0
- end
- end
- local rules_table={
- [1] = "spierdalajs1asdasda sdpierdalajspie rdalajspierdal ajspierdalaasdasjspierd alajspierdalaj spierdalaj",
- [2] = "wypierdalaj",
- [3] = "frajerze",
- [4] = "kurwo",
- [5] = "ssij druta",
- [6] = "jebać extrema",
- [7] = "i chuj",
- [8] = "1",
- [9] = "2",
- [10] = "3",
- [11] = "4",
- [12] = "5",
- }
- for i=1,#rules_table do
- if not rules then
- rules=i..". "..wordWrap(rules_table[i], 70)
- else
- rules=rules.."\n"..i..". "..wordWrap(rules_table[i], 70)
- end
- end
- local dxfont0_AkrobatLight = dxCreateFont("/fonts/Akrobat-Light.otf", 16/(zoom/1.15))
- local dxfont1_AkrobatLight = dxCreateFont("/fonts/Akrobat-Light.otf", 12/(zoom/1.15))
- current_view = "logging"
- class "login_client"
- {
- __init__ = function(self)
- self.camRender = function()
- if (sm.moov == 1) then
- local x1,y1,z1 = getElementPosition(object1)
- local x2,y2,z2 = getElementPosition(object2)
- setCameraMatrix(x1,y1,z1,x2,y2,z2)
- end
- end
- self.smoothMoveCamera = function(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
- if(sm.moov == 1)then return false end
- object1 = Object(1337,x1,y1,z1)
- object2 = Object(1337,x1t,y1t,z1t)
- setElementAlpha(object1,0)
- setElementAlpha(object2,0)
- setObjectScale(object1,0.01)
- setObjectScale(object2,0.01)
- moveObject(object1,time,x2,y2,z2,0,0,0,"InOutQuad")
- moveObject(object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
- sm.moov = 1
- setTimer(removeCamHandler,time,1)
- setTimer(destroyElement,time,1,object1)
- setTimer(destroyElement,time,1,object2)
- return true
- end
- self.inPosition = function(x,y,w,h)
- 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 + w) and (cy >= y and cy <= y + h) then
- return true
- else
- return false
- end
- end
- self.error = function(text)
- warning=text
- if timer and timer.valid then timer:destroy() end
- timer=Timer(function() warning=false end, 3000, 1)
- end
- self.onClick = function(btn,state)
- if btn=="left" and state=="up" then
- if self.inPosition(606/zoom, 47/zoom, 150/zoom, 157/zoom) and not animating and current_view ~= "logging" then
- current_alpha = 255
- animating=true
- animation_level=1
- animation=Timer(function()
- if animation_level == 1 then
- current_alpha=current_alpha-7.5
- elseif animation_level == 2 then
- current_alpha=current_alpha+7.5
- end
- if animation_level == 1 and current_alpha == 0 then
- animation_level=2
- current_view="logging"
- elseif animation_level == 2 and current_alpha == 255 then
- animation:destroy()
- animating=false
- current_alpha=false
- end
- end, 50, 0)
- elseif self.inPosition(885/zoom, 47/zoom, 150/zoom, 157/zoom) and not animating and current_view ~= "registering" then
- current_alpha = 255
- animating=true
- animation_level=1
- animation=Timer(function()
- if animation_level == 1 then
- current_alpha=current_alpha-7.5
- elseif animation_level == 2 then
- current_alpha=current_alpha+7.5
- end
- if animation_level == 1 and current_alpha == 0 then
- animation_level=2
- current_view="registering"
- elseif animation_level == 2 and current_alpha == 255 then
- animation:destroy()
- animating=false
- current_alpha=false
- end
- end, 50, 0)
- elseif self.inPosition(1165/zoom, 47/zoom, 150/zoom, 157/zoom) and not animating and current_view ~= "rules" then
- current_alpha = 255
- animating=true
- animation_level=1
- animation=Timer(function()
- if animation_level == 1 then
- current_alpha=current_alpha-7.5
- elseif animation_level == 2 then
- current_alpha=current_alpha+7.5
- end
- if animation_level == 1 and current_alpha == 0 then
- animation_level=2
- current_view="rules"
- elseif animation_level == 2 and current_alpha == 255 then
- animation:destroy()
- animating=false
- current_alpha=false
- end
- end, 50, 0)
- elseif self.inPosition(1005/zoom, 727/zoom, 34/zoom, 31/zoom) and (current_view=="logging") then
- save_password=not save_password
- elseif self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and (current_view=="registering") then
- gender="men"
- elseif self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and (current_view=="registering") then
- gender="women"
- elseif self.inPosition(810/zoom, 763/zoom, 301/zoom, 65/zoom) and (current_view=="logging" or current_view=="registering") and not cooldown then
- local login=edit:getCustomEditboxText('LOGGING-LOGIN')
- local password=edit:getCustomEditboxText('LOGGING-PASSWORD')
- if string.len(login) < 4 or string.len(password) < 4 then
- self.error("Login i hasło muszą zawierać minimalnie 4 znaki!")
- return
- end
- if (current_view=="registering" and not gender) then
- self.error("Nie wybrano płci!")
- return
- end
- triggerServerEvent("logging:event", localPlayer, current_view, login, password, (current_view=="logging") and save_password or gender)
- cooldown=true
- t_cooldown=Timer(function()
- cooldown=false
- t_cooldown:destroy()
- end, 1750, 1)
- end
- end
- end
- self.render = function()
- if isTransferBoxActive() == false then
- if not data then
- data=true
- setElementData(localPlayer, "after:download", true)
- end
- screenSource:update()
- blurShader:setValue("screenSource", screenSource)
- blurShader:setValue("screenSize", {screenWidth, screenHeight})
- blurShader:setValue("blurStrength", blurStrength)
- blurShader:setValue("saturation", saturation)
- blurShader:setValue("brightness", brightness)
- blurShader:setValue("contrast", contrast)
- edit=exports.editbox
- if not edit:isCustomEditboxCreated('LOGGING-PASSWORD') then
- --edit:createEditBox('LOGGING-LOGIN', 737/zoom, 546/zoom, 454/zoom, 44/zoom, true, "", false, 14, "arial", false, 3, { 0, 0, 0, 180 }, true, { 128, 128, 128, 250 }, 2, true, 60, false, "..", { 0, 0, 0, 170 }, true, 2, "arial", true, true, {255, 255, 255}, true )
- --edit:createEditBox('LOGGING-PASSWORD', 737/zoom, 649/zoom, 454/zoom, 44/zoom, true, "", true, 40, "arial", false, 0, { 0, 0, 0, 180 }, true, { 128, 128, 128, 250 }, 2, true, 60, false, "..", { 0, 0, 0, 170 }, true, 2, "arial", true, true, {255, 255, 255}, true )
- edit:createCustomEditbox('LOGGING-LOGIN', '', 737/zoom, 546/zoom, 454/zoom, 44/zoom, false, '', 14)
- edit:createCustomEditbox('LOGGING-PASSWORD', '', 737/zoom, 649/zoom, 454/zoom, 44/zoom, true, '', 40)
- end
- edit:customEditboxSetAlpha('LOGGING-LOGIN', current_alpha or 255)
- edit:customEditboxSetAlpha('LOGGING-PASSWORD', current_alpha or 255)
- dxSetRenderTarget(renderTarget4x4, true)
- dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
- dxSetRenderTarget()
- if warning then
- dxDrawText(warning, 605/zoom, 858/zoom, 1314/zoom, 924/zoom, tocolor(203, 0, 0, 255), 1.00, dxfont0_AkrobatLight, "center", "top", false, true, false, false, false)
- end
- local ls,rs = intro:getLevelData()
- if ls then
- bt = tonumber(ls)/100
- if bt then if bt > 255 then bt = 255 elseif bt < 20 then bt = 20 end end
- end
- if not bt then bt=255 end
- dxDrawImage(-340/zoom, 0/zoom, 683/zoom, 1076/zoom, "img/shadow.png", 0, 0, 0, tocolor(255, 255, 255, bt or 255), true)
- dxDrawImage(1590/zoom, 0/zoom, 683/zoom, 1076/zoom, "/img/shadow.png", 54, 0, 0, tocolor(255, 255, 255, bt or 255), true)
- --exports["blur"]:dxDrawBluredRectangle(0,0,screenWidth,screenHeight,tocolor(255,255,255,255))
- dxDrawImage(572/zoom, 194/zoom, 777/zoom, 693/zoom, "/img/window.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawImage(606/zoom, 47/zoom, 150/zoom, 157/zoom, "/img/loginicon.png", 0, 0, 0, tocolor(255, 255, 255, self.inPosition(606/zoom, 47/zoom, 150/zoom, 157/zoom) and 200 or 255), false)
- dxDrawImage(1165/zoom, 47/zoom, 150/zoom, 157/zoom, "/img/rulesicon.png", 0, 0, 0, tocolor(255, 255, 255, self.inPosition(1165/zoom, 47/zoom, 150/zoom, 157/zoom) and 200 or 255), false)
- dxDrawImage(885/zoom, 47/zoom, 150/zoom, 157/zoom, "/img/registericon.png", 0, 0, 0, tocolor(255, 255, 255, self.inPosition(885/zoom, 47/zoom, 150/zoom, 157/zoom) and 200 or 255), false)
- if (current_view=="logging") then
- dxDrawImage(810/zoom, 763/zoom, 301/zoom, 65/zoom, "/img/loginbtn.png", 0, 0, 0, tocolor(255, 255, 255, cooldown and 50 or current_alpha or self.inPosition(810/zoom, 763/zoom, 301/zoom, 65/zoom) and 200 or 255), false)
- --dxDrawImage(733/zoom, 536/zoom, 454/zoom, 64/zoom, "/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or (editbox_selected == editbox_login) and 200 or 255), false)
- dxDrawText("LOGOWANIE", 604/zoom, 424/zoom, 1315/zoom, 508/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont0_AkrobatLight, "center", "center", false, false, false, false, false)
- dxDrawText("WPISZ LOGIN:", 743/zoom, 522/zoom, 1177/zoom, 540/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont1_AkrobatLight, "left", "top", false, false, false, false, false)
- --dxDrawImage(733/zoom, 639/zoom, 454/zoom, 64/zoom, "/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or (editbox_selected == editbox_password) and 200 or 255), false)
- dxDrawText("WPISZ HASŁO:", 743/zoom, 623/zoom, 1177/zoom, 644/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont1_AkrobatLight, "left", "top", false, false, false, false, false)
- dxDrawText("ZAPAMIĘTAJ HASŁO", 884/zoom, 732/zoom, 995/zoom, 753/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont1_AkrobatLight, "left", "top", false, false, false, false, false)
- dxDrawImage(1005/zoom, 727/zoom, 34/zoom, 31/zoom, save_password and "/img/checkbox_on.png" or "/img/checkbox_off.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or 255), false)
- edit:customEditboxSetText('LOGGING-LOGIN', edit:getCustomEditboxText('LOGGING-LOGIN'):gsub("[^%w%b-.]", ""))
- elseif (current_view=="registering") then
- dxDrawImage(810/zoom, 763/zoom, 301/zoom, 65/zoom, "/img/registerbtn.png", 0, 0, 0, tocolor(255, 255, 255, cooldown and 50 or current_alpha or self.inPosition(810/zoom, 763/zoom, 301/zoom, 65/zoom) and 200 or 255), false)
- --dxDrawImage(733/zoom, 536/zoom, 454/zoom, 64/zoom, "/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or (editbox_selected == editbox_login) and 200 or 255), false)
- dxDrawText("REJESTRACJA", 604/zoom, 424/zoom, 1315/zoom, 508/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont0_AkrobatLight, "center", "center", false, false, false, false, false)
- dxDrawText("WPISZ LOGIN:", 743/zoom, 522/zoom, 1177/zoom, 540/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont1_AkrobatLight, "left", "top", false, false, false, false, false)
- --dxDrawImage(733/zoom, 639/zoom, 454/zoom, 64/zoom, "/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or (editbox_selected == editbox_password) and 200 or 255), false)
- dxDrawText("WPISZ HASŁO:", 743/zoom, 623/zoom, 1177/zoom, 644/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont1_AkrobatLight, "left", "top", false, false, false, false, false)
- if gender == "men" then
- dxDrawImage(900/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/men.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(902/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/men.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(901/zoom, 706/zoom, 58/zoom, 58/zoom, "/img/men.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(901/zoom, 704/zoom, 58/zoom, 58/zoom, "/img/men.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- elseif gender == "women" then
- dxDrawImage(958/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/women.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(960/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/women.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(959/zoom, 704/zoom, 58/zoom, 58/zoom, "/img/women.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(959/zoom, 706/zoom, 58/zoom, 58/zoom, "/img/women.png", 0, 0, 0, tocolor(0, 0, 0, current_alpha or self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- end
- dxDrawImage(901/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/men.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or self.inPosition(901/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- dxDrawImage(959/zoom, 705/zoom, 58/zoom, 58/zoom, "/img/women.png", 0, 0, 0, tocolor(255, 255, 255, current_alpha or self.inPosition(959/zoom, 705/zoom, 58/zoom, 58/zoom) and 200 or 255), false)
- edit:customEditboxSetText('LOGGING-LOGIN', edit:getCustomEditboxText('LOGGING-LOGIN'):gsub("[^%w%b-.]", ""))
- elseif (current_view=="rules") then
- dxDrawText(rules, 610/zoom, 430/zoom, 1309/zoom, 848/zoom, tocolor(255, 255, 255, current_alpha or 255), 1.00, dxfont0_AkrobatLight, "center", "top", false, false, false, false, false)
- end
- end
- end
- self.wycisz = function(dzwiek)
- local level=dzwiek.volume
- if level>0 then
- dzwiek:setVolume(level-0.03)
- setTimer(self.wycisz, 50, 1, dzwiek)
- else
- dzwiek:destroy()
- end
- end
- self.savePassword = function(l,h)
- if not File.exists("cache.mp4") then
- local file=File.new("cache.mp4")
- if file then
- str=l..";"..teaEncode(h, string.reverse("6N5u7MCtZgpDDs3PbJVvJKbzuDk"))..""
- str=teaEncode(str, "6N5u7MCtZgpDDs3PbJVvJKbzuDk")
- if not file:write(str) then
- File.delete("cache.mp4")
- end
- file:close()
- end
- end
- end
- self.loadSavedAccount = function()
- if File.exists("cache.mp4") then
- file = File.open("cache.mp4")
- if not file then return end
- txt = file:read(file.size) or ""
- txt=teaDecode(txt, "6N5u7MCtZgpDDs3PbJVvJKbzuDk")
- local tabela=split(txt, ";")
- edit:customEditboxSetText('LOGGING-LOGIN', tabela[1])
- edit:customEditboxSetText('LOGGING-PASSWORD', teaDecode(tabela[2], string.reverse("6N5u7MCtZgpDDs3PbJVvJKbzuDk")))
- save_password=true
- file:close()
- end
- end
- self.deleteSavedPassword = function()
- if File.exists("cache.mp4") then
- File.delete("cache.mp4")
- end
- end
- self.successful = function(save_psswd,l,h)
- edit:customEditboxSetAlpha('LOGGING-LOGIN', 0)
- edit:customEditboxSetAlpha('LOGGING-PASSWORD', 0)
- Timer(function()
- showChat(true)
- edit:destroyCustomEditbox('LOGGING-LOGIN')
- edit:destroyCustomEditbox('LOGGING-PASSWORD')
- removeEventHandler("onClientRender", root, self.render)
- removeEventHandler("onClientClick", root, self.onClick)
- removeEventHandler("onClientPreRender", root, self.camRender)
- self.wycisz(intro)
- showCursor(false)
- setCameraTarget(localPlayer)
- if save_psswd then
- self.deleteSavedPassword()
- self.savePassword(l,h)
- else
- self.deleteSavedPassword()
- end
- blurShader:destroy()
- setPlayerHudComponentVisible("radar", true)
- setPlayerHudComponentVisible("crosshair", true)
- triggerEvent("rpg:noti", localPlayer, "info", "Pomyślnie zalogowano do gry!")
- end, 50, 1)
- end
- if not edit:isCustomEditboxCreated('LOGGING-PASSWORD') then
- edit:createCustomEditbox('LOGGING-LOGIN', '', 737/zoom, 546/zoom, 454/zoom, 44/zoom, false, '', 14)
- edit:createCustomEditbox('LOGGING-PASSWORD', '', 737/zoom, 649/zoom, 454/zoom, 44/zoom, true, '', 40)
- end
- fadeCamera(true)
- showCursor(true)
- showChat(false)
- screenSource = dxCreateScreenSource(screenWidth, screenHeight)
- blurShader = dxCreateShader("shaders/blur.fx")
- setFarClipDistance(1000)
- addEventHandler("onClientRender", root, self.render)
- addEventHandler("onClientClick", root, self.onClick)
- setPlayerHudComponentVisible("all",false)
- self.loadSavedAccount()
- --edit:createEditBox('LOGGING-LOGIN', 737/zoom, 546/zoom, 454/zoom, 44/zoom, false, "", false, 15, "arial", true, 3, { 0, 0, 0, 180 }, true, { 255, 255, 255, 0 }, 2, true, 60, true, "", { 0, 0, 0, 255 }, true, 5, "arial", true, true, {0, 114, 210, 255}, true)
- --edit:createEditBox('LOGGING-PASSWORD', 737/zoom, 649/zoom, 454/zoom, 44/zoom, false, "", false, 48, "arial", true, 3, { 0, 0, 0, 180 }, true, { 255, 255, 255, 0 }, 2, true, 60, true, "", { 0, 0, 0, 255 }, true, 5, "arial", true, true, {0, 114, 210, 255}, true)
- self.smoothMoveCamera(1.22937011719, 2501.9123535156, 155.541263580322, 366.80487060547, 2505.2980957031, 1.64319610596, -1652.9017333984, 2702.9978027344, 141.80680847168, -1510.9653320313, 2640.2353515625, 90.090293884277, 90000)
- addEventHandler("onClientPreRender", root, self.camRender)
- addEventHandler("logging:successful", localPlayer, self.successful)
- addEventHandler("logging:alert", localPlayer, self.error)
- intro=Sound("sounds/intro.mp3", true)
- end,
- };
- if not localPlayer:getData("user:uid") then
- local login_instance=login_client();
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement