Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if getElementData(localPlayer, "player:sid") then return end
- local root = getRootElement()
- local resourceRoot = getResourceRootElement(getThisResource())
- local screenWidth, screenHeight = guiGetScreenSize()
- intro_step=math.random(0,850)
- setElementDimension(localPlayer, 0)
- local blurStrength = 20
- local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
- blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")
- 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
- 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)
- x,y=2513.58, 1282.80-- my width
- intro_step=math.random(0,850)
- local sx,sy=guiGetScreenSize()
- local data={ showed=nil, button={}, info=nil, misc=nil, }
- 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
- local dist = 100
- local angler = 0
- function getPointFromDistanceRotation(x, y, dist, angler)
- local a = math.rad(90 - angler)
- local dx = math.cos(a) * dist;
- local dy = math.sin(a) * dist;
- return x+dx, y+dy;
- end
- function renderLoginBox()
- --dxDrawImage(0, 0, 1920, 1080, "misc/drift.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawRectangle(sx*357/1025, sy*0/769, sx*320/1025, sy*958/767, tocolor(25, 25, 25, 220), false)
- --dxDrawImage(0, 0, 1920, 1080, "misc/drift.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
- if data.info then dxDrawText(data.info, sx*515/1024, sy*530/768, sx*515/1024, sy*530/768, tocolor(255, 80, 80, 255), 1.8, "bold", "center", "center", false) end
- --dxDrawLine(sx*0/1024, sy*199/768, sx*1022/1024, sy*200/768, tocolor(31, 111, 193, 255), 5, false)
- --dxDrawLine(sx*0/1024, sy*509/768, sx*1022/1024, sy*510/768, tocolor(31, 111, 193, 255), 5, false)
- dxDrawText("Nazwa użytkownika", sx*460/1024, sy*410/768, sx*565/1024, sy*325/768, white, 1.50, "default-bold", "center", "center", false)
- dxDrawText("Hasło", sx*460/1024, sy*590/768, sx*565/1024, sy*302/768, white, 1.50, "default-bold", "center", "center", false)
- if not isMouseIn(sx*416/1024, sy*565/768, sx*200/1024, sy*35/768) then dxDrawRectangle(sx*416/1024, sy*565/768, sx*200/1024, sy*35/768, tocolor(255,255,255, 170), false)
- else dxDrawRectangle(sx*411/1024, sy*565/768, sx*208/1024, sy*35/768, tocolor(255,255,255, 230), false) end
- if not isMouseIn(sx*416/1024, sy*615/768, sx*200/1024, sy*35/768) then dxDrawRectangle(sx*416/1024, sy*615/768, sx*200/1024, sy*35/768, tocolor(255,255,255, 170), false)
- else dxDrawRectangle(sx*411/1024, sy*615/768, sx*208/1024, sy*35/768, tocolor(255,255,255, 230), false) end
- dxDrawText("Z a l o g u j s i ę", sx*460/1024, sy*1120/768, sx*565/1024, sy*45/768, tocolor(0,0,0,255), 1.7, "default-bold", "center", "center", false)
- dxDrawText("Z a r e j e s t r u j s i ę", sx*460/1024, sy*1220/768, sx*565/1024, sy*45/768, tocolor(0,0,0,255), 1.7, "default-bold", "center", "center", false)
- --dxDrawImage(sx * 0.016, sy * 0.0413, sx * 0.2838, sy * 0.2749, "logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- --dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png", angle, 0, -120 )
- --local x,y=getPointFromDistanceRotation(-2648.46, -5.59, dist, angler)
- --setCameraMatrix(x,y,80.72+0.9,1100.69, -3500.66, -2600+0.9)
- --angler=(angler+0.1)
- local abckamera1=math.sin(intro_step/-500)*9000
- local abckamera2=math.cos(intro_step/-500)*9000
- setCameraMatrix (-2648.48, -5.48, 20.29, abckamera1, abckamera2, -1500)
- --setCameraMatrix(zone1, zone2, 120, zone1, zone2, 120)
- intro_step=intro_step-1.8
- dxDrawImage(sx*315/1024, sy*10/768, sx*400/1024, sy*400/768, "image/logo.png")
- end
- ---2648.46,-5.59,45.29
- addEventHandler("onClientClick", root, function(btn,state)
- if btn=="left" and state=="down" then
- if isMouseIn(sx*416/1024, sy*565/768, sx*200/1024, sy*35/768) and data.showed then
- local login=guiGetText(data.button[1])
- local pass=guiGetText(data.button[2])
- if string.len(login) < 2 or string.len(pass) < 2 then
- data.info="Należy wypełnić wszystkie pola."
- return
- end
- triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
- end
- if isMouseIn(sx*416/1024, sy*615/768, sx*200/1024, sy*35/768) 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
- data.info="Login i hasło powinno zawierać od 3 do 22 znaków."
- 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)
- -- Usuwamy elementy
- destroyElement(data.button[1])
- destroyElement(data.button[2])
- removeEventHandler("onClientRender", root, renderLoginBox)
- else
- data.info=tostring(info)
- setTimer(function() data.info=nil end, 3000, 1)
- end
- end)
- local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" }
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
- function ()
- showChat(false)
- showCursor(true)
- fadeCamera(true)
- data.showed=true
- setElementAlpha(localPlayer,0)
- data.misc=playSound("music/music.mp3",true)
- --setPlayerHudComponentVisible("radar", false)
- setSoundVolume(data.misc, 1.0)
- setPlayerHudComponentVisible( components, false )
- guiSetInputMode("no_binds_when_editing")
- setElementData(localPlayer,"status","Loguje się")
- --setElementData(localPlayer,"player:logged",false)
- addEventHandler("onClientRender", root, renderLoginBox)
- local nick = getPlayerName( localPlayer )
- data.button[1]=guiCreateEdit(0.395, 0.50, 0.22, 0.04, ""..nick.."", true)
- data.button[2]=guiCreateEdit(0.395, 0.60, 0.22, 0.04, "", true)
- guiEditSetMasked(data.button[2],true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement