Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if getElementData(localPlayer, "player:sid") then return end
- local sx, sy = guiGetScreenSize()
- local actual = false
- local root = getRootElement()
- local tick = getTickCount()
- local resourceRoot = getResourceRootElement(getThisResource())
- local screenWidth, screenHeight = guiGetScreenSize()
- addEventHandler("onClientResourceStop", resourceRoot,
- function()
- if (blurShader) then
- destroyElement(blurShader)
- blurShader = nil
- end
- end)
- local sm = {}
- sm.moov = 0
- sm.object1,sm.object2 = nil,nil
- local function removeCamHandler()
- if(sm.moov == 1)then
- sm.moov = 0
- end
- end
- local function camRender()
- if (sm.moov == 1) then
- local x1,y1,z1 = getElementPosition(sm.object1)
- local x2,y2,z2 = getElementPosition(sm.object2)
- setCameraMatrix(x1,y1,z1,x2,y2,z2)
- end
- end
- addEventHandler("onClientPreRender",root,camRender)
- function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
- if(sm.moov == 1)then return false end
- sm.object1 = createObject(1337,x1,y1,z1)
- sm.object2 = createObject(1337,x1t,y1t,z1t)
- setElementAlpha(sm.object1,0)
- setElementAlpha(sm.object2,0)
- setObjectScale(sm.object1,0.01)
- setObjectScale(sm.object2,0.01)
- moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
- moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
- sm.moov = 1
- setTimer(removeCamHandler,time,1)
- setTimer(destroyElement,time,1,sm.object1)
- setTimer(destroyElement,time,1,sm.object2)
- return true
- end
- x,y=2313.58, 1282.80-- my width
- intro_step=math.random(0,850)
- local muzyka = false
- local sw,sh = guiGetScreenSize()
- local zoom = 1
- if sw < 1920 then
- zoom = math.min(2, 1920 / sw)
- end
- function getCenter(x, y)
- x,y = x / zoom, y / zoom
- return (sw / 2) - (x / 2), (sh / 2) - (y / 2)
- end
- 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 = 200
- local angler = 0
- function getPointFromDistanceRotation(x, y, dist, angler)
- local a = math.rad(270 - angler)
- local dx = math.cos(a) * dist;
- local dy = math.sin(a) * dist;
- return x+dx, y+dy;
- end
- local dxfont0_font = dxCreateFont("font.ttf", 15)
- local texture_1 = dxCreateTexture('img/login-psrpg.png','argb',true,'clamp')
- local texture_4 = dxCreateTexture('img/registericon-psrpg.png','argb',true,'clamp')
- local texture_3 = dxCreateTexture('img/register-psrpg.png','argb',true,'clamp')
- local texture_2 = dxCreateTexture('img/loginicon-psrpg.png','argb',true,'clamp')
- function renderLoginBox()
- if sy < 1049 then
- x_3, y_3 = getCenter(400,-900)
- else
- x_3, y_3 = getCenter(400,-550)
- end
- if actual == 'login' then
- local x_1, y_1 = getCenter(400,550); local x_4, y_4 = getCenter(-850,300)
- dxDrawImage(x_1, y_1, 400/zoom, 550/zoom, texture_1, 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawImage(x_4, y_4, 300/zoom, 300/zoom, texture_2, 0, 0, 0, tocolor(255, 255, 255, 255), false)
- elseif actual == 'register' then
- local x_1, y_1 = getCenter(400,550); local x_4, y_4 = getCenter(1450,300)
- dxDrawImage(x_1, y_1, 400/zoom, 550/zoom, texture_3, 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawImage(x_4, y_4, 300/zoom, 300/zoom, texture_4, 0, 0, 0, tocolor(255, 255, 255, 255), false)
- end
- if data.info then
- dxDrawText("INFO:\n"..data.info, x_3 + 1, y_3 + 1, (1161 + 1)/zoom, (890 + 1)/zoom, tocolor(0, 0, 0, 255), 1, dxfont0_font, "center", "center", false, false, false, false, false)
- dxDrawText("INFO:\n"..data.info, x_3, y_3, 1161/zoom, 890/zoom, tocolor(255, 255, 255, 255), 1, dxfont0_font, "center", "center", false, false, false, false, false)
- end
- smoothMoveCamera(1352.95, -1784.73, 57.37, 1426.97, -1749.14, 57.37, 1517.11, -1753.13, 57.37, 1744.15, -1746.72, 57.37, 45000)
- end
- 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
- addEventHandler("onClientClick", root, function(btn,state)
- if btn=="left" and state=="down" then
- local x_2, y_2 = getCenter(285,-302)
- local x_4, y_4 = getCenter(-850,300)
- local x1_4, y1_4 = getCenter(1450,300)
- if isMouseIn(x_2, y_2, 285/zoom, 65/zoom) and data.showed and actual == 'login' then
- local login=guiGetText(zaloguj)
- local pass=guiGetText(zarejestruj)
- if string.len(login) < 2 or string.len(pass) < 2 then
- data.info="Aby się zalogować należy wypełnić wszystkie pola."
- return
- end
- triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
- elseif isMouseIn(x_2, y_2, 285/zoom, 65/zoom) and data.showed and actual == 'register' then
- local login=guiGetText(zaloguj)
- local pass=guiGetText(zarejestruj)
- if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
- data.info="Nazwa/Hasło Użytkownika musi zawierać od 3 do 22 znaków"
- return
- end
- triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
- elseif isMouseIn(x_4,y_4,300/zoom,300/zoom) and data.showed and actual == 'login' then
- actual = 'register'
- elseif isMouseIn(x1_4,y1_4,300/zoom,300/zoom) and data.showed and actual == 'register' then
- actual = 'login'
- 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(muzyka)
- destroyElement(zaloguj)
- destroyElement(zarejestruj)
- removeEventHandler("onClientRender", root, renderLoginBox)
- removeEventHandler("onClientPreRender",root,camRender)
- local tick = getTickCount()
- else
- data.info=tostring(info)
- setTimer(function() data.info=nil end, 3000, 1)
- end
- end)
- addEventHandler("onClientResourceStart", resourceRoot, function()
- showChat(false)
- showCursor(true)
- fadeCamera(true)
- data.showed=true
- setElementAlpha(localPlayer,0)
- local tick = getTickCount()
- muzyka=playSound("misc/intro.mp3",true)
- actual = 'login'
- setSoundVolume(muzyka, 1.0)
- showPlayerHudComponent("all",false)
- guiSetInputMode("no_binds_when_editing")
- setElementData(localPlayer,"status","Loguje siÄ™")
- addEventHandler("onClientRender", root, renderLoginBox)
- local x_edit, y_edit = getCenter(304,190)
- zaloguj=guiCreateEdit(x_edit, y_edit, 304/zoom, 35/zoom, "", false)
- local x_edit_2, y_edit_2 = getCenter(304,-100)
- zarejestruj=guiCreateEdit(x_edit_2, y_edit_2, 304/zoom, 35/zoom, "", false)
- guiEditSetMasked(zarejestruj,true)
- guiEditSetMaxLength(zaloguj, 22)
- guiEditSetMaxLength(zarejestruj, 22)
- guiSetAlpha(zaloguj,0.60)
- guiSetAlpha(zarejestruj,0.60)
- guiSetVisible(zaloguj,true)
- guiSetVisible(zarejestruj,true)
- end)
- addCommandHandler('matrix',function()
- local one,two,three,four,five,six,seven,eight = getCameraMatrix()
- outputChatBox((one)..','..(two)..','..(three)..','..(four)..','..(five)..','..(six)..','..(seven)..','..(eight))
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement