Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Resource: Logging
- Servers: MTATruckers
- Developers: SataN <kontaktthinks@gmail.com>
- Copyright <kontaktthinks@gmail.com> 2019
- You have no right to use this code without my permission.
- ]]
- foncik = dxCreateFont("font.ttf",14) or "default"
- local sw1,sh1 = guiGetScreenSize()
- local sw, sh = sw1/1280,sh1/800
- local cx,cy = guiGetScreenSize()
- local sx, sy = cx/1280,cy/800
- local dist = 120
- local angler = 0
- local minesY = 0
- sx, sy = guiGetScreenSize( )
- shaderMatrix = dxCreateShader( ":3danim/matrix.fx" )
- img = dxCreateTexture( "logowa.png" )
- local rt = dxCreateRenderTarget(1280, 800, true)
- img = dxCreateTexture( "logowa.png" )
- dxSetShaderValue( shaderMatrix, "gTexture", img)
- dxSetRenderTarget(rt)
- dxDrawImage(0, 0, 1280, 800, img)
- dxSetRenderTarget()
- dxSetShaderValue( shaderMatrix, "gTexture", rt)
- rX, rY = 0, 0
- local root = getRootElement()
- local resourceRoot = getResourceRootElement(getThisResource())
- local startTicking = getTickCount()
- local progress = (getTickCount() - startTicking) + 2300
- local progress2 = (getTickCount() - startTicking) + 2300
- local progress3 = (getTickCount() - startTicking) + 2300
- cameraX, cameraY = 977.59, 1734.23
- local mtat={ pokaz=nil, button={}, notif=nil, music=nil, }
- 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 renderLogowanie()
- if mtat.notif then dxDrawText(mtat.notif, 146*sw, 471*sh, 249*sw, 42*sh, tocolor(255, 255, 255, 255), 1.00, foncik, "center", "center", false, false, false, false, false) end
- if mtat.music then
- local bit = getSoundFFTData(mtat.music, 2048, 2)
- for i,v in ipairs(bit) do
- anim = math.round((v *430), 30) > 100 and 100 or math.round((v * 430), 30)
- rytm = math.round((v*430),30)>100 and 100 or math.round((v*430),30)
- dxDrawImage(sw*0, sh*0, sw*1280, sh*800, "strzalka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawImage(sw*0-(anim/2), sh*0-(anim/2), sw*1280+anim, sh*800+anim, "light.png", 0, 0, 0, tocolor(221, 211, 30, rytm), false)
- local progress = (getTickCount() - startTicking) / 2300
- if tonumber(progress2) >= 1 and tonumber(progress3) >= 1 then
- exports["mtat-edit"]:createEditBox( "1", 0.38, 0.44, 0.25, 0.08, true, "", false, 16, foncik, false, 0, {221, 211, 30, 255 }, true, { 255, 255, 255, 0 }, 0.5, true, 60, true, "", { 255, 255, 255, 100 }, true, 3, "", true, false, {0, 114, 210}, false )
- exports["mtat-edit"]:createEditBox( "2", 0.38, 0.56, 0.25, 0.08, true, "", true, 16, "arial", false, 0, {221, 211, 30, 255 }, true, { 255, 255, 255, 0 }, 2, true, 60, true, "", { 255, 255, 255, 100 }, true, 3, "z", true, false, {0, 114, 210}, false )
- if isCursorShowing( ) then
- cX, cY = getCursorPosition( )
- rX, rY = (cX - 0.5) * 15, (cY - 0.5) * 15
- end
- dxSetShaderTransform( shaderMatrix, -rX, rY )
- dxDrawImage( sx * 0, sy * 0, 1280, 800, rt)
- end
- end
- end
- end
- addEventHandler("onClientClick", root, function(btn,state)
- if btn=="left" and state=="down" then
- if isCursorOnElement(sw*486, sh*574, sw*305, sh*37) and mtat.pokaz then
- local login= exports["mtat-edit"]:getText("1")
- local password= exports["mtat-edit"]:getText("2")
- if string.len(login) < 2 or string.len(password) < 2 then
- mtat.notif="Wypełnij wszystkie pola!"
- outputChatBox(tostring(foncik))
- return
- end
- triggerServerEvent("logowanie:sprawdzKonto", resourceRoot, login, password)
- end
- end
- end)
- addEvent("logowanie:wynik", true)
- addEventHandler("logowanie:wynik", resourceRoot, function(value,notif)
- if not notif then notif="" end
- if value then
- mtat.pokaz=false
- showZones(mtat.music)
- removeEventHandler("onClientRender", root, renderLogowanie)
- exports["mtat-edit"]:deleteEditBox("1")
- exports["mtat-edit"]:deleteEditBox("2")
- else
- mtat.notif=tostring(notif)
- setTimer(function() mtat.notif=nil end, 3000, 1)
- end
- end)
- addEventHandler("onClientResourceStart", resourceRoot, function()
- showChat(false)
- showCursor(true)
- mtat.pokaz=true
- setElementAlpha(localPlayer,0)
- mtat.music=playSound("music/music.mp3",true)
- setSoundVolume(mtat.music, 1.0)
- showPlayerHudComponent("all",false)
- addEventHandler("onClientRender", root, renderLogowanie)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement