Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. --[[
  2. Resource: Logging
  3. Servers: MTATruckers
  4. Developers: SataN <kontaktthinks@gmail.com>
  5. Copyright <kontaktthinks@gmail.com> 2019
  6. You have no right to use this code without my permission.
  7. ]]
  8. foncik = dxCreateFont("font.ttf",14) or "default"
  9. local sw1,sh1 = guiGetScreenSize()
  10. local sw, sh = sw1/1280,sh1/800
  11. local cx,cy = guiGetScreenSize()
  12. local sx, sy = cx/1280,cy/800
  13. local dist = 120
  14. local angler = 0
  15. local minesY = 0
  16.  
  17. sx, sy = guiGetScreenSize( )
  18.  
  19. shaderMatrix = dxCreateShader( ":3danim/matrix.fx" )
  20. img = dxCreateTexture( "logowa.png" )
  21.  
  22. local rt = dxCreateRenderTarget(1280, 800, true)
  23. img = dxCreateTexture( "logowa.png" )
  24. dxSetShaderValue( shaderMatrix, "gTexture", img)
  25.  
  26. dxSetRenderTarget(rt)
  27. dxDrawImage(0, 0, 1280, 800, img)
  28. dxSetRenderTarget()
  29. dxSetShaderValue( shaderMatrix, "gTexture", rt)
  30.  
  31. rX, rY = 0, 0
  32.  
  33. local root = getRootElement()
  34. local resourceRoot = getResourceRootElement(getThisResource())
  35. local startTicking = getTickCount()
  36. local progress = (getTickCount() - startTicking) + 2300
  37. local progress2 = (getTickCount() - startTicking) + 2300
  38. local progress3 = (getTickCount() - startTicking) + 2300
  39. cameraX, cameraY = 977.59, 1734.23
  40. local mtat={ pokaz=nil, button={}, notif=nil, music=nil, }
  41.  
  42. function math.round(number, decimals, method)
  43. decimals = decimals or 0
  44. local factor = 10 ^ decimals
  45. if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  46. else return tonumber(("%."..decimals.."f"):format(number)) end
  47. end
  48.  
  49. function renderLogowanie()
  50. 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
  51. if mtat.music then
  52. local bit = getSoundFFTData(mtat.music, 2048, 2)
  53. for i,v in ipairs(bit) do
  54. anim = math.round((v *430), 30) > 100 and 100 or math.round((v * 430), 30)
  55. rytm = math.round((v*430),30)>100 and 100 or math.round((v*430),30)
  56. dxDrawImage(sw*0, sh*0, sw*1280, sh*800, "strzalka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  57. 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)
  58. local progress = (getTickCount() - startTicking) / 2300
  59. if tonumber(progress2) >= 1 and tonumber(progress3) >= 1 then
  60. 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 )
  61. 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 )
  62. if isCursorShowing( ) then
  63. cX, cY = getCursorPosition( )
  64. rX, rY = (cX - 0.5) * 15, (cY - 0.5) * 15
  65. end
  66. dxSetShaderTransform( shaderMatrix, -rX, rY )
  67. dxDrawImage( sx * 0, sy * 0, 1280, 800, rt)
  68.  
  69. end
  70. end
  71. end
  72. end
  73.  
  74.  
  75. addEventHandler("onClientClick", root, function(btn,state)
  76. if btn=="left" and state=="down" then
  77. if isCursorOnElement(sw*486, sh*574, sw*305, sh*37) and mtat.pokaz then
  78. local login= exports["mtat-edit"]:getText("1")
  79. local password= exports["mtat-edit"]:getText("2")
  80. if string.len(login) < 2 or string.len(password) < 2 then
  81. mtat.notif="Wypełnij wszystkie pola!"
  82. outputChatBox(tostring(foncik))
  83. return
  84. end
  85. triggerServerEvent("logowanie:sprawdzKonto", resourceRoot, login, password)
  86. end
  87. end
  88. end)
  89. addEvent("logowanie:wynik", true)
  90. addEventHandler("logowanie:wynik", resourceRoot, function(value,notif)
  91. if not notif then notif="" end
  92. if value then
  93. mtat.pokaz=false
  94. showZones(mtat.music)
  95. removeEventHandler("onClientRender", root, renderLogowanie)
  96. exports["mtat-edit"]:deleteEditBox("1")
  97. exports["mtat-edit"]:deleteEditBox("2")
  98.  
  99. else
  100. mtat.notif=tostring(notif)
  101. setTimer(function() mtat.notif=nil end, 3000, 1)
  102. end
  103. end)
  104.  
  105. addEventHandler("onClientResourceStart", resourceRoot, function()
  106. showChat(false)
  107. showCursor(true)
  108. mtat.pokaz=true
  109. setElementAlpha(localPlayer,0)
  110. mtat.music=playSound("music/music.mp3",true)
  111. setSoundVolume(mtat.music, 1.0)
  112. showPlayerHudComponent("all",false)
  113. addEventHandler("onClientRender", root, renderLogowanie)
  114.  
  115. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement