Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if getElementData(localPlayer, "player:uid") then return end
- local blurStrength = 20
- local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
- blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")
- function renderblur()
- if blur == true then
- dxUpdateScreenSource(myScreenSource)
- dxSetShaderValue(blurShader, "ScreenSource", myScreenSource);
- dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
- dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight);
- dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
- end
- end
- addEventHandler("onClientRender", root, renderblur)
- addEventHandler("onClientResourceStop", resourceRoot,
- function()
- if (blurShader) then
- destroyElement(blurShader)
- blurShader = nil
- end
- end)
- local root = getRootElement()
- local dxfont0_fontbold = dxCreateFont("font-bold.ttf", 20)
- local dxfont1_fontbold = dxCreateFont("font-bold.ttf", 26)
- local resourceRoot = getResourceRootElement(getThisResource())
- local screenWidth, screenHeight = guiGetScreenSize()
- screenW, screenH = guiGetScreenSize()
- local sx,sy=guiGetScreenSize()
- local data={ showed=nil, button={}, info=nil, misc=nil, tick=getTickCount() }
- function isMouseIn(psx,psy,pssx,pssy,abx,aby)
- if not isCursorShowing() then return end
- cx,cy=getCursorPosition()
- cx,cy=cx*sx,cy*sy
- if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
- return true,cx,cy
- else
- return false
- end
- end
- dist = 300
- angler = 25
- function getPointFromDistanceRotation(x, y, dist, angler)
- local losuj = math.random(0, 360)
- local a = math.rad(60 - angler)
- local dx = math.cos(a) * dist;
- local dy = math.sin(a) * dist;
- return x+dx, y+dy;
- end
- function getCenter(sx,sy)
- local screenW, screenH = guiGetScreenSize()
- local x, y = (screenW - sx) /2,(screenH - sy) /2
- return x, y
- end
- posx,posy=getCenter(740,462)
- function getCenter(sx,sy)
- local screenW, screenH = guiGetScreenSize()
- local x, y = (screenW - sx) /2,(screenH - sy) /2
- return x, y
- end
- posxx,posyy=getCenter(365,30)
- mojeW,mojeH = 1920,1080
- sW,sH = guiGetScreenSize()
- w, h = (sW/mojeW), (sH/mojeH)
- local x,y = guiGetScreenSize()
- local f = x / 1024
- local nY = y*f
- function roundedRectangle(x, y, w, h, color)
- dxDrawRectangle(x, y, w, h, color, false)
- dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
- dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
- dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
- dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
- end
- aktualnie="logowanie"
- function renderLoginBox()
- function math.round(number, decimals, method)
- decimals = decimals or 0
- local factor = 10 ^ decimals
- if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
- else return tonumber(("%."..decimals.."f"):format(number)) end
- end
- local a = interpolateBetween(0,0,0,255,255,255,((getTickCount()-tick)/1300),"Linear")
- local a2 = interpolateBetween(0,0,0,151,151,151,((getTickCount()-tick)/1300),"Linear")
- local a3 = interpolateBetween(0,0,0,45,45,45,((getTickCount()-tick)/1300),"Linear")
- --dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":er-pobieranie/images/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- roundedRectangle(screenW * 0.0000, screenH * 0.3000, screenW * 1.0000, screenH * 0.4000, tocolor(0, 0, 0, a2), false)
- local bt = getSoundFFTData(data.misc,2048,230)
- if(not bt) then return end
- for i,v in pairs(bt) do
- tlo = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
- dxDrawImage(screenW * 0.4000, screenH * 0.3300, screenW * 0.2000, screenH * 0.3500, ":er-logowanie/img/logo_tlo.png", 0, 0, 0, tocolor(255, 255, 255, tlo/2.2), false) -- to co miga za logo
- end
- dxDrawImage(screenW * 0.4000, screenH * 0.3300, screenW * 0.2000, screenH * 0.3500, ":er-logowanie/logo.png", 0, 0, 0, tocolor(255, 255, 255, a), false) -- zwyczajne logo
- if(not bt) then return end
- for i,v in pairs(bt) do
- skoki = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
- odleglosc = 0.3700
- --dxDrawRectangle(screenW * 0.0000+(i * screenW * 0.0210*odleglosc), screenH * 0.2995, screenH * 0.0416*odleglosc, screenH * 0.0020 * skoki*-1, tocolor(90,90,90, a2), false)
- --dxDrawRectangle(screenW * 0.0000+(i * screenW * 0.0210*odleglosc), screenH * 0.7005, screenH * 0.0416*odleglosc, screenH * 0.0020 * skoki*1, tocolor(90,90,90, a2), false)
- end
- dxDrawRectangle(screenW * 0.0600, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600, tocolor(90,90,90, a), false) -- button od logowania
- dxDrawRectangle(screenW * 0.0200, screenH * 0.3175, screenW * 0.3500, screenH * 0.0600, tocolor(90,90,90, a), false) -- logowanie
- dxDrawRectangle(screenW * 0.6700, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600, tocolor(90,90,90, a), false) -- button od rejestracji
- dxDrawRectangle(screenW * 0.6300, screenH * 0.3175, screenW * 0.3500, screenH * 0.0600, tocolor(90,90,90, a), false) -- rejestracja
- local hype2 = interpolateBetween(0, 0, 0, -15, 100, 0, ((getTickCount() - tick) / 2500), "SineCurve")
- dxDrawText("Muzyka: Zaza - Be Together [NCS Release]", screenW * 0.0000, screenH * 0.8300 + hype2, screenW * 1.0000, screenH * 0.0600, tocolor(255, 255, 255, a3), 0.75*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
- dxDrawText("Logowanie", screenW * 0.0900, screenH * 0.3300, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
- dxDrawImage(screenW * 0.0200, screenH * 0.4250, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/user.png", 0, 0, 0, tocolor(255,255,255, a), false)
- dxDrawImage(screenW * 0.0200, screenH * 0.5500, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/pass.png", 0, 0, 0, tocolor(255,255,255, a), false)
- dxDrawText("Zaloguj się", screenW * 0.0900, screenH * 1.2500, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
- dxDrawText("Rejestracja", screenW * 1.3300, screenH * 0.3300, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
- dxDrawImage(screenW * 0.6300, screenH * 0.4250, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/user.png", 0, 0, 0, tocolor(255,255,255, a), false)
- dxDrawImage(screenW * 0.6300, screenH * 0.5500, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/pass.png", 0, 0, 0, tocolor(255,255,255, a), false)
- dxDrawText("Załóż konto", screenW * 1.3300, screenH * 1.2500, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
- --local polozenie_kamery = interpolateBetween(0, 0, 0, 1, 6, 0, ((getTickCount() - tick) / 6500), "SineCurve")
- --setCameraMatrix(54.71, 98.51, 69.31+polozenie_kamery, 237.86, -129.06, 2.04+polozenie_kamery)
- local x,y=getPointFromDistanceRotation(230.27,-125.07, dist, angler)
- setCameraMatrix(x,y,50+0.9,230.27,-125.07,1.43+0.9)
- angler=(angler+0.0015+skoki/4550)
- if data.info then
- dxDrawText(data.info, (screenW * 9.3000) + 1, (screenH * 0.7519) + 1, (screenW * 0.7047) + 1, (screenH * 0.2481) + 1, tocolor(0, 0, 0, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
- dxDrawText(data.info, screenW * 9.3000, screenH * 0.7519, screenW * 0.7047, screenH * 0.2481, tocolor(229, 0, 0, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
- end
- setTimer(function()
- showChat(false)
- end, 50, 10)
- end
- addEventHandler("onClientClick", root, function(btn,state)
- if btn=="left" and state=="down" then
- if isMouseIn(screenW * 0.0600, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600) and data.showed then
- local login=guiGetText(data.button[1])
- local pass=guiGetText(data.button[2])
- if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
- exports["er-notyfikacje"]:showBox("error", "Login oraz hasło muszą posiadać od 3 do 22 znaków!")
- data.tick=getTickCount()+5000
- return
- end
- if string.find(login, "#") ~= nil or string.find(login, "@") ~= nil or string.find(login, "?") ~= nil or string.find(login, "!") ~= nil then
- exports["er-notyfikacje"]:showBox("error", "Posiadasz niedozwolony znak w Twoim loginie!")
- data.tick=getTickCount()+5000
- return
- end
- triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
- end
- if isMouseIn(screenW * 0.6700, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600) and data.showed then
- local login=guiGetText(data.button[3])
- local pass=guiGetText(data.button[4])
- if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
- exports["er-notyfikacje"]:showBox("error", "Login oraz hasło muszą posiadać od 3 do 22 znaków!")
- data.tick=getTickCount()+5000
- return
- end
- if string.find(login, "#") ~= nil or string.find(login, "@") ~= nil or string.find(login, "?") ~= nil or string.find(login, "!") ~= nil then
- exports["er-notyfikacje"]:showBox("error", "Posiadasz niedozwolony znak w Twoim loginie!")
- data.tick=getTickCount()+5000
- return
- end
- triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
- end
- end
- end)
- addEvent("logging:result", true)
- addEventHandler("logging:result", resourceRoot, function(value,info)
- if not info then info="" end
- if value then
- data.showed=false
- showZones(data.misc)
- destroyElement(data.button[1])
- destroyElement(data.button[2])
- destroyElement(data.button[3])
- destroyElement(data.button[4])
- removeEventHandler("onClientRender", root, renderLoginBox)
- else
- data.info=info
- data.tick=getTickCount()+5000
- end
- end)
- addEventHandler("onClientResourceStart", resourceRoot, function()
- setTime(22, 0)
- tick = getTickCount()
- data.misc=playSound("http://ts-zagadaj.pl/test.mp3",true)
- addEventHandler("onClientRender", root, renderLoginBox)
- showChat(false)
- showCursor(true)
- fadeCamera(true)
- data.showed=true
- setElementAlpha(localPlayer,0)
- setSoundVolume(data.misc, 0.6)
- showPlayerHudComponent("all",false)
- showPlayerHudComponent("radar", false)
- guiSetInputMode("no_binds_when_editing")
- setElementData(localPlayer,"status","Loguje się")
- data.button[1] = guiCreateEdit(0.055, 0.423, 0.315, 0.04, "", true)
- data.button[2] = guiCreateEdit(0.055, 0.548, 0.315, 0.04, "", true)
- data.button[3] = guiCreateEdit(0.665, 0.423, 0.315, 0.04, getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x",""), true)
- data.button[4] = guiCreateEdit(0.665, 0.548, 0.315, 0.04, "", true)
- guiEditSetMasked(data.button[2], true)
- guiEditSetMasked(data.button[4], true)
- end)
- function filedelet ()
- if fileExists("c_logging.lua") then
- fileDelete("c_logging.lua")
- end
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), filedelet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement